Show Menu

Looking for an iOS Developer?

Submit your 30 day Job Listing for FREE

In Swift and iOS 8 SDK you can present an alert view as shown in the code below :


var alert = UIAlertController(title: “Alert Title", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)

alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)

You can also add destructive and cancel actions by setting the style property to Destructive and Cancel respectively.

having issues?

We have a Questions and Answer section where you can ask your iOS Development questions to thousands of iOS Developers.

Ask Question

FREE Download!

Get your FREE Swift 2 Cheat Sheet and quick reference guide PDF download when you sign up to SwiftMonthly


Sharing is caring

If you enjoyed this tutorial, please help us and others by sharing using one of the social media buttons below.


Written by:

I am 17 years old, student and amateur iOS app developer, computer and technology enthusiast. Check out my apps using the link provided and also use the other link to follow me on twitter

Comments

comments