let os = NSProcessInfo().operatingSystemVersion
switch (os.majorVersion, os.minorVersion, os.patchVersion) {
case (8, _, _):
print("iOS >= 8.0.0")
case (7, 0, _):
print("iOS >= 7.0.0, = 7.1.0, < 8.0.0")
default:
print("iOS = 8.0")
}
NSProcessInfo().isOperatingSystemAtLeastVersion(NSOperatingSystemVersion(majorVersion: 0, minorVersion: 0, patchVersion: 0))