Wils
Wils

Reputation: 1211

How to deal with: UIActionSheet deprecated (iOS8) X UIAlertController not supported (iOS7)

The UIActionSheet is deprecated on iOS 7 and the docs suggest to use UIAlertController however UIAlertController is not supported on iOS7 :P

My code will run if I do use the UIActionSheet in iOS8, there's a warning :P but it runs...

I wondering to know if is there another alternative instead of just leaving the deprecated code and make sure that it works for both iOS (7/8).

tkx

Upvotes: 3

Views: 2048

Answers (2)

jverdi
jverdi

Reputation: 1506

If you are writing shared code that can be used on both iOS 7 as well as an iOS 8 extension - where the UIAlertView/UIActionSheet APIs are restricted - have a look at JVAlertController.

It's an open-source back-port UIAlertController to iOS 7 that I created to work around this.

Upvotes: 2

David Silverfarmer
David Silverfarmer

Reputation: 455

Like @rmaddy pointed out you should set your deployment target to iOS 7 and use UIActionSheet. That way you will not get any warnings and your code runs on both iOS 7/8!

Upvotes: 0

Related Questions