Created
February 14, 2017 11:10
-
-
Save fozoglu/a2012515f4412d0bad3349e0912fe77f to your computer and use it in GitHub Desktop.
openURL hem 10.0 versiyonu hem de eski versiyonlarda çalışması için hazırlanmış bir metot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func open(scheme: String) { | |
if let url = URL(string: scheme) { | |
if #available(iOS 10, *) { | |
UIApplication.shared.open(url, options: [:], | |
completionHandler: { | |
(success) in | |
print("Open \(scheme): \(success)") | |
}) | |
} else { | |
let success = UIApplication.shared.openURL(url) | |
print("Open \(scheme): \(success)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment