Tutorial by Examples

Swift 3: let minimumVersion = OperatingSystemVersion(majorVersion: 8, minorVersion: 1, patchVersion: 2) if ProcessInfo().isOperatingSystemAtLeast(minimumVersion) { //current version is >= (8.1.2) } else { //current version is < (8.1.2) }
let minimumVersionString = "3.1.3" let versionComparison = UIDevice.current.systemVersion.compare(minimumVersionString, options: .numeric) switch versionComparison { case .orderedSame, .orderedDescending: //current version is >= (3.1.3) break case .orderedA...
if #available(iOS 9, *) { // iOS 9 } else { // iOS 8 or earlier }
This will give current system version. Objective-C NSString *version = [[UIDevice currentDevice] systemVersion] Swift let version = UIDevice.currentDevice().systemVersion Swift 3 let version = UIDevice.current.systemVersion

Page 1 of 1