UIAlertController or Bust

You know what I never liked? UIAlertView. You know what’s been deprecated in iOS 8?

That’s right.

UIAlertView.

It (along with UIActionSheet) has been replaced by UIAlertController. There’s a great full rundown of the differences between old-style alerts and the new UIAlertController over at NSHipster, but below is a quick example of how to show a simple confirmation alert:

I especially love the flexibility of UIAlertActionStyle, which allows you to specify whether an action is a cancellation or is in some way destructive.

Leave a Reply

Your email address will not be published. Required fields are marked *