I\'m currently developing an App, that needs to open a browser to display a webpage. To do that i use the [UIApplication sharedApplication] openURL method with
[UIApplication sharedApplication] openURL
Here is the answer in Swift 3.0 with a check to see if we can open the URL or not.
guard let url = URL(string: myURLString) else { return } if UIApplication.shared.canOpenURL(url) { DispatchQueue.main.async { UIApplication.shared.openURL(url) } }