0
On Swift 4 the code would look like this:
UIApplication.shared.openURL(URL(string: "http://www.quatenus.co.ao")!)
In your code is not with error, the Xcode is only warning that there was an update in the function call (only Shared)
0
2
On Swift 4 the code would look like this:
UIApplication.shared.openURL(URL(string: "http://www.quatenus.co.ao")!)
In your code is not with error, the Xcode is only warning that there was an update in the function call (only Shared)
2
Using Swift 3 the code would look like this:
@IBAction func urlDisplay(_ sender: AnyObject) {
let url = URL(string: "http://www.quatenus.co.ao/")!
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.openURL(url)
}
}
Browser other questions tagged swift xcode swift-playground
You are not signed in. Login or sign up in order to post.
Ops. o Xcode da erro de: 'openURL' was deprecated in iOS 10.0: Please use openURL:options:completionHandler: Instead
– An. Jorge
This message is a Warning and not an error. I compiled the code in iOS 10 and it worked normally. You can make the change that Xcode is suggesting without any problem.
– Leonardo Cesar Teixeira