NSURLSesssionDataTask In Swift

Here is the correct syntax with the completionHandler as a closure:


let task : NSURLSessionDataTask = session.dataTaskWithURL(NSURL(string: "url"),completionHandler: {(data: NSData!, response: NSURLResponse!, error: NSError!) -> Void in
   return
})

Leave a Reply

Your email address will not be published. Required fields are marked *