NewYorkAlertController
public final class NewYorkAlertController : UIViewController
Create an alert similar to UIAlertController
-
Styles indicating the type of NewYorkAlert to display.
See moreDeclaration
Swift
public enum Style -
Indicates if alert can be dismissed via background tap.
Declaration
Swift
public var isTapDismissalEnabled: Bool { get set } -
The array of text fields displayed by the alert.
Declaration
Swift
public private(set) var textFields: [UITextField]
-
Creates a standard NewYorkAlert with title, message and style.
Declaration
Swift
public init(title: String?, message: String?, style: Style)Parameters
titleA title of alert.
messageA message of alert.
styleA style of alert to display.
Return Value
A NewYorkAlertController object.
-
Called when the view is about to made visible. Buttons and text fields will be actually added to NewYorkAlert here.
Declaration
Swift
public override func viewWillAppear(_ animated: Bool)
-
Adds a button to the NewYorkAlert.
Note
If the button’s style is
NewYorkButton.Style.cancel, the button will always be added to the bottom of the NewYorkAlert. If the number of buttons added to the NewYorkAlert is two and thestyleproperty is set toNewYorkAlertController.Style.alert, buttons will be displayed horizontally and the cancel button will be displayed on the left.Declaration
Swift
public func addButton(_ button: NewYorkButton)Parameters
buttonA button to be added to the NewYorkAlert.
-
Adds buttons to the NewYorkAlert.
Note
If the button’s style is
NewYorkButton.Style.cancel, the button will always be added to the bottom of the NewYorkAlert. If the number of buttons added to the NewYorkAlert is two and thestyleproperty is set toNewYorkAlertController.Style.alert, buttons will be displayed horizontally and the cancel button will be displayed on the left.Declaration
Swift
public func addButtons(_ buttons: [NewYorkButton])Parameters
buttonsAn array of buttons to be added to the NewYorkAlert.
-
Adds a text field to the NewYorkAlert.
Note
You can add a text field only if the
styleproperty is set toNewYorkAlertController.Style.alert.Declaration
Swift
public func addTextField(configurationHandler: ((UITextField) -> Void)? = nil)Parameters
configurationHandlerA block for configuring the text field prior to displaying the NewYorkAlert.
-
Adds an image to the NewYorkAlert.
Note
You can add only one image to the NewYorkAlert.
Declaration
Swift
public func addImage(_ image: UIImage?)Parameters
imageAn image to be added to the NewYorkAlert
NewYorkAlertController Class Reference