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 trialNehemiah Reese
17,692 PointsUIAlertViews 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
Courses Plus Student 11,071 PointsUIAlertController is the new way to present both alerts and action sheets.
See Apple Docs for further reference. Always worth a read: UIAlertController on NSHipster
Nehemiah Reese
17,692 PointsGot it working thanks man!
Howard Hughes
Courses Plus Student 84 PointsAdd 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)