写了一个判断ios8或者以后版本的逻辑,大家看看有没有问题?
let curSystemVersion:String = UIDevice.currentDevice().systemVersion
let strRange = Range<String.Index>(start:curSystemVersion.startIndex,end:curSystemVersion.endIndex)
let dotIndex = curSystemVersion.rangeOfString(".", options: NSStringCompareOptions.DiacriticInsensitiveSearch, range: strRange)!
let iosVersion:Int = curSystemVersion.substringToIndex(dotIndex.startIndex).toInt()!
if(iosVersion >= 8){
return true
}else{
return false
}