On Xcode 11.5 (Swift 5.2.4) the compiler gets confused and shows the error below:
Cannot convert value of type '(URLSession) -> (URL, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask' to type '(URLSession) -> (URLRequest, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask' in coercion
I'm trying to get the selector like follows, but the compiler still tries to convert to the version with URL instead:
let selector = #selector(URLSession.dataTask(with:completionHandler:) as (URLSession) -> (URLRequest, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask)
Aucun commentaire:
Enregistrer un commentaire