urlsession
HTTP load failed (error code: -999 [1:89]) for Task in iOS 11
HTTP load failed (error code: -999 [1:89]) for Task Error -999 means NSURLErrorCancelled, your request has been canceled before completion. According to the apple developer blog, there are few changes with ATS (likely that your server is using one of legacy crypto facilities that have been removed in iOS 11.) So give a try and … Read more
Invalid conversion from throwing function of type (_,_,_) throws -> Void to non-throwing function type (NSData?, NSURLResponse?, NSError?) -> Void
You need to implement Do Try Catch error handling as follow: import UIKit import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution = true extension URL { func asyncDownload(completion: @escaping (_ data: Data?, _ response: URLResponse?, _ error: Error?) -> ()) { URLSession.shared .dataTask(with: self, completionHandler: completion) .resume() } } let jsonURL = URL(string: “https://api.whitehouse.gov/v1/petitions.json?limit=100”)! let start = Date() jsonURL.asyncDownload { … Read more