Quantcast
Channel: How to create an alert box in iphone? - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Pallavi for How to create an alert box in iphone?

$
0
0

Here i provided the alert message, which i used in my first app:

@IBAction func showMessage(sender: UIButton) {
    let alertController = UIAlertController(title: "Welcome to My First App",
                              message: "Hello World",
                              preferredStyle: UIAlertControllerStyle.alert)
    alertController.addAction(UIAlertAction(title: "OK",
                                            style: UIAlertActionStyle.default,
                                            handler: nil))
    present(alertController, animated: true, completion: nil)
}

with appropriate handlers for user responses.


Viewing all articles
Browse latest Browse all 11

Trending Articles