I'm using the method openURL:options:completionHandler:, it turns out that in iOS 10 works fine, but I'm also interested in my app is compatible with the old iOS 9, but xcode gives me a
NSException:
-[UIApplication openURL:options:completionHandler:]:
Unrecognized selector send to instance There any way make it work in iOS 9 also? Thank for the possible response!
The new UIApplication method openURL:options:completionHandler:, which is executed asynchronously and calls the specified completion handler on the main queue (this method replaces openURL:)
This is under Additional Framework Changes > UIKit at: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewIniOS/Articles/iOS10.html
you need use it like this:-
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With