I'm doing
if !UIApplication.shared.openURL(url) {
print("Error")
}
The issue is that I've the message error in the console and I'm seeking how to know what specific HTTP error is thrown.
You can get your responses by doing something like this.
let URL = URL(string: "www.google.com")
let task = URLSession.shared.dataTask(with:url!) { _, response, _ in
if let status = response as? HTTPURLResponse {
print(status.statusCode)
}
}
task.resume()
Apologies for any syntax issues. No XCode available at the moment.