iOS 8 及更高版本
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)
}