Deferral is just a note that the function may be removed in a future version. However, an obsolete class or method still works.
So, you can just continue to use UIAlertView
and face the risk of hacking in a future version of iOS. It still works on iOS 9. There is no guarantee that it will continue to work with iOS 10.
The best solution here is to check if the UIAlertController
is available at runtime . If so, use this class for your warning, otherwise return to UIAlertView
.
Usually you do not check the version of iOS! Itβs better to check if a method or class is available, except in very rare cases when Apple explicitly tells you to check the version of iOS: this happens when a method that was considered private was published by Apple.
source share