Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Self-Destructing Message iPhone App Using Parse.com as a Backend and Adding Users Signing Up New Users: Part 1 (UIAlertView)

UIAlertViews are deprecated in iOS9, any suggestions on what I should use instead?

Compiler instructs me to use UIAlertController but when I alloc and init an instance is says something about the interface.

3 Answers

Martin Wildfeuer
PLUS
Martin Wildfeuer
Courses Plus Student 11,071 Points

UIAlertController is the new way to present both alerts and action sheets.

See Apple Docs for further reference. Always worth a read: UIAlertController on NSHipster

Got it working thanks man!

Howard Hughes
PLUS
Howard Hughes
Courses Plus Student 84 Points

Add this lines on your if statement : let alertController = UIAlertController(title: "Opps!", message: "Make sure you enter a username, password and email addres", preferredStyle: .Alert) let cancelAction = UIAlertAction(title: "Ok", style: .Default, handler: nil)

        alertController.addAction(cancelAction)
        presentViewController(alertController, animated: true, completion: nil)