iOS (기능)
[SWIFT] 시스템 버전 값 비교(String Float Compare)
겸손할 겸
2021. 5. 25. 16:28
메모 기록용
// standardOS :: Web에서 내려주는 기준 값/ 테스트 완료
let standardOS: String = "14.4.1"
let currentOS = UIDevice.current.systemVersion
let result = currentOS.compare(standardOS, options: .numeric, range: nil, locale: nil)
if result == .orderedAscending{
// currentOS가 standard보다 낮다
print("[Gyeom] result : orderedAscending")
}else if result == .orderedDescending{
// cureentOS가 standard보다 높다
print("[Gyeom] result : orderedDescending")
}else{
print("[Gyeom] result : orderedSame")
}