Skip to content

Instantly share code, notes, and snippets.

@joseph-elmallah
Created December 9, 2018 20:47
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 joseph-elmallah/a0450b1f9f4779608fb9e3a0816709e7 to your computer and use it in GitHub Desktop.
Save joseph-elmallah/a0450b1f9f4779608fb9e3a0816709e7 to your computer and use it in GitHub Desktop.
The conformance of UIApplication to the URLHandler protocol
// MARK: - URLHandler conformance
extension UIApplication: URLHandler {
func handleURL(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any], completionHandler completion: ((Bool) -> Void)?) {
// If we reach the end of the responder chain without anyone handeling the URL, ask the Applciation to handle it
open(url, options: options, completionHandler: completion)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment