Skip to content

Instantly share code, notes, and snippets.

@fozoglu
Created February 14, 2017 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fozoglu/a2012515f4412d0bad3349e0912fe77f to your computer and use it in GitHub Desktop.
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
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