Skip to content

Instantly share code, notes, and snippets.

@xionglun
Created November 4, 2014 14:01
Show Gist options
  • Save xionglun/24e2018bad3390c8a184 to your computer and use it in GitHub Desktop.
Save xionglun/24e2018bad3390c8a184 to your computer and use it in GitHub Desktop.
iOS swift detect OS version
switch UIDevice.currentDevice().systemVersion.compare("8.0.0", options: NSStringCompareOptions.NumericSearch) {
case .OrderedSame, .OrderedDescending:
println("iOS >= 8.0")
case .OrderedAscending:
println("iOS < 8.0")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment