Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexnikol
Last active April 19, 2020 05:27
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 alexnikol/ee65023b254ce1cd5fad8b6afcf60fc9 to your computer and use it in GitHub Desktop.
Save alexnikol/ee65023b254ce1cd5fad8b6afcf60fc9 to your computer and use it in GitHub Desktop.
Swift 4. Open website from iOS Application
guard let url = URL(string: "https://www.google.com/"), //Create non-optional URL to our website
UIApplication.shared.canOpenURL(url) else { //Check if app can open this URL
return
}
UIApplication.shared.open(url) //Open our website in Safari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment