I am using the following code to post an image to my server.
@IBAction func postButtonPressed(sender: UIButton) {
let task = NSURLSession.sharedSession(
It is late to reply but I recently face the error while running the new application assigned to me. The application is one of them whose URL Domains are blocked by the system administrator of my company.
I ask them to allow me the URL access after which the response came and the application run perfectly.
This may be not the actual solution for everyone but some of the developers may have the restricted environment can get help by this.