var session = NSURLSession.sharedSession() session.dataTaskWithRequest(urlRequest, completionHandler: {(data: NSData!,
Are you using playgrounds??
If you are, you should be careful to include:
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)
In order to make the playground wait for the callback