Skip to content

Instantly share code, notes, and snippets.

@rldaulton
Created February 28, 2019 19:59
Show Gist options
  • Save rldaulton/c544b7fcb49a4c789812b4089f061f06 to your computer and use it in GitHub Desktop.
Save rldaulton/c544b7fcb49a4c789812b4089f061f06 to your computer and use it in GitHub Desktop.
You should always check if a link is univeral, before opening it in any browser session of SFSafariView
let url = URL(string: "https://youtu.be/5IVsLLlRNXc")!
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { (success) in
if !success {
// not a universal link or app not installed
let vc = SFSafariViewController(url: url)
self.present(vc, animated: true)
}
}
@phansen-nd
Copy link

Yeah the file looks okay with that tool. Just thought I'd check - thanks anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment