Swift 3 changed many part of codes. I have problems to convert the below code to Swift 3. Somebody knows how to write on Swift 3
session.dataTaskWithURL(url! as URL, completionHandler: { (data : NSData?, response : URLResponse?, error : NSError?) -> Void in
if error != nil {
callback(items: nil, errorDescription: error!.localizedDescription, placesDetail: [])
}
if let statusCode = response as? NSHTTPURLResponse {
if statusCode.statusCode != 200 {
callback(items: nil, errorDescription: "Could not continue. HTTP Status Code was \(statusCode)", placesDetail: [])
}
}
NSOperationQueue.mainQueue().addOperationWithBlock({ () -> Void in
callback(items: GooglePlaces.parseFromData(data!), errorDescription: nil, placesDetail: GooglePlaces.arrayPlaces(data!))
})
}).resume()