swift3 - How can I incorporate both iOS 9.3 & iOS 10 codes into my App? -
scenario:
have existing ios 9.3 application 5th-generation itouch can handle.
i want add ios 10-savvy code application , able filter existing code can continue working old itouch.
however, compiler refuses build if deployment target set @ ios 9.3 or lower:
there work-around or must create new application?
possible solution:
1. build ios 10.0+ deployment; then
2. filter via in-code @available(ios 10.0, *).
itouch can't handle ios 10; i'm hope above solution work.
you use #available
if #available(ios 10, *) { uiapplication.shared.open(url, options: [:], completionhandler: { (success) in guard success else { //handle error return } }) } else { _ = uiapplication.shared.openurl(url) } }
Comments
Post a Comment