I can't seem to fetch from a valid URL database.
I have the following code:
print("calling")
let session = NSURLSession.sharedSession()
let url = NSURL(string: "valid url")
let request = NSURLRequest(URL: url!)
let dataTask = session.dataTaskWithRequest(request) { (data:NSData?, response:NSURLResponse?, error:NSError?) -> Void in
print("done, error: \(error)")
}
dataTask.resume()
print("end calling")
However, it seems as though the print within the request does not get output at all.
The only output I see is calling and end calling
What am I seem to be doing wrong with my implementation?
Thanks