My app's deployment target is 7.0 . I want to use both UIAlertController and UIAlertView. I read somewhere that checking for iOS versions is not good, so i used this code :
if (NSClassFromString("UIAlertController") != nil) {
// UIAlertController
} else {
// UIAlertView
But even if do that, i still get that "correctable" error "UIAlertController is only available on iOS 8.0 or newer" and i have to choose between 3 'Fix-it' options :
- Add 'if #available' version check ( if #available(iOS 8.0, *) { ... } else { ... })
- Add @available attribute to enclosing instance method
- Add @available attribute to enclosing class
What should i do ? Currently using Xcode 7 GM