I have the following code:
let urlPath:String = apiURL + apiVersion + url + "?api_key=" + apiKey let url = NSURL(string: urlPath) let session = NSURLSession.sharedSession() println(url!) let task = session.dataTaskWithURL(url!, completionHandler: {(data, reponse, error) in println("Task completed")
The Handler completion function is never called. I tried to call the url in my browser, it works fine. I tried with a different url, it still does not work. I checked that my ios simulator can connect to the internet, it does.
I do not know why the function is not called, and since I do not have any error that is difficult to debug.
source share