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 *

Latest Posts

  • Guard! Guard!

    Swift 2 introduced the guard keyword, a handy bit of syntactic sugar with semantics similar…

  • UIResponder and Swift 2.0

    I was revisiting an older Swift 1.0 project this morning, and discovered that, in the…

  • The App Classifieds

    I’ve taken a break from app development to launch something different: a classified listings site…