Develope/Swift

Swift 기초 - API 버전 확인방법

Jason park@ 2016. 6. 12. 00:00
반응형


*Swift API 버전별 예외처리 방법



if #available(iOS 9, OSX 10.10, *) {

    // Use iOS 9 APIs on iOS, and use OS X v10.10 APIs on OS X

} else {

    // Fall back to earlier iOS and OS X APIs

}


다음에서 발췌: Apple Inc. ‘The Swift Programming Language (Swift 2.2).’ iBooks. https://itun.es/kr/jEUH0.l

반응형