This source codes alerts your users if they use your app with an unsupported version of iOS (e.g. iOS 10.0 beta). The alert looks like this:
Works with iOS 7.0 upwards (please test with iOS 7 if you still have Xcode 6 installed).
The AlertController shows only ONCE for each system version (e.g. only once for iOS 10.0 beta). If you would like to change this behavior, you can do this in the checkOSVersion method by removing the NSUserDefaults if queries.
- Drag the UnsupportedOSVersionAlert.swift file into your project
- Make your AppDelegate a delegate of OSVersionCheckerDelegate
class AppDelegate: UIApplicationDelegate, OSVersionCheckerDelegate
- Implement the delegate method in your AppDelegate
func didCheckOSVersion(supported: Bool) {
if !supported {
self.window?.makeKeyAndVisible()
OSVersionAlert.show()
}
}
- In your application didFinishLaunchingWithOptions, use the OSVersionChecker API to set the delegate, the earliest supported version and the latest supported version
OSVersionChecker.checkOSVersion(self, earliest: "8.1", latest: "9.1.3")
- [Work in Progress] Drag the language files into your project.
- If you'd like to contribute please submit a pull request via GitHub.
- Speaking a language that is currently not supported by UnsupportedOSVersionAlert? Provide us your Localizations.
Like UnsupportedOSVersionAlert? Get us a beer ;-)
Feel free to use this source in any of your projects. If you'd like to acknowledge the author, feel free to link to www.caloon.co.