var session = NSURLSession.sharedSession() session.dataTaskWithRequest(urlRequest, completionHandler: {(data: NSData!,
So I tried calling it like this
session.dataTaskWithRequest(urlRequest, completionHandler: {(data: NSData!, response: NSURLResponse!, error: NSError!) in print(data) print(response) print(error) }).resume()
And it worked.
Seems like I have to call resume() on a default suspended session task.
resume()