Awesome Open Source
Awesome Open Source

STAlertController

Language Platform Version License

A subclass of UIAlertController that can be presented one by one in a queue

STAlertController is a subclass of UIAlertController that can be presented one by one in a queue. When STAlertController is clicked and disappears, the next STAlertController will be presented.

STAlertControllerPreview01

Requirements

  • iOS 8.0 or later
  • ARC
  • Swift 5.0

Installation

STAlertController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'STAlertController'

Usage

Import headers in your source files

In the source files where you need to use the library, import the header file:

import STAlertController

Initialize STAlertController

Use the following function to initialize the STAlertController:

let alertController = STAlertController(title: "Title", message: "Message", preferredStyle: .alert)

Initialize STAlertAction

Use the following function to initialize the STAlertAction:

let alertAction = STAlertAction.createAction(title: "OK", style: .cancel) { action in
    print("Clicked OK")
}

AddAction

Use the following function to add the STAlertAction to the STAlertController:

alertController.addAction(alertAction)

PresentAlertController

At last, use the following function to present the STAlertController on an instance of UIViewcontroller:

presentAlertController(alertController)

DismissAlertController

Of course, the following methods can also be used to dimiss the STAlertController:

dismissAlertController()

Author

Suta, [email protected]

License

MIT license.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Swift (94,970
Queue (1,749
Alert (864
Uialertcontroller (68
Alertcontroller (29
Related Projects