I’m using AFHTTPRequestOperation
in swift like this :
let operation : AFHTTPRequestOperation? = manager.GET(requestURL, parameters: nil,
success: { (operation:AFHTTPRequestOperation!, responseObject:AnyObject!) -> Void in
...
...
...
success(downloadedItems: responseObject)
}, failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in
failure(responseFromCache: responseFromCache, error: error);
})
and I’m using setCacheResponseBlock for application specific purpose (ETag etc.)
operation!.setCacheResponseBlock { (connection: NSURLConnection, cachedResponse: NSCachedURLResponse) -> NSCachedURLResponse in print("Returns:200") responseFromCache = false return cachedResponse }
Everything was OK until updating XCode to new version XCode7.1.
Here is my problem, I get this error when I build my application after update :
Cannot convert value of type '(NSURLConnection, NSCachedURLResponse) -> NSCachedURLResponse' to expected argument type '((NSURLConnection!, NSCachedURLResponse!) -> NSCachedURLResponse!)!'
How to fix this?