While using Swift 1 this code worked fine:
let connectionSession = NSURLSession.sharedSession()
let task = connectionSession.dataTaskWithURL(currentURL!, completionHandler: { (data, response , error) in
...
In Swift 2 I am getting the following compiler error:
Invalid conversion from throwing function of type '(_, _, _) throws -> _' to non-throwing function type '(NSData?, NSURLResponse?, NSError?) -> Void'
How can I fix this?
you can use with the optional values like that