Last active
April 19, 2020 05:27
-
-
Save alexnikol/ee65023b254ce1cd5fad8b6afcf60fc9 to your computer and use it in GitHub Desktop.
Swift 4. Open website from iOS Application
This file contains 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
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