I am using the following code to post an image to my server.
@IBAction func postButtonPressed(sender: UIButton) { let task = NSURLSession.sharedSession(
In my case issue was in 3rd party library - FirebasePerformance. Bug report URL: https://github.com/firebase/firebase-ios-sdk/issues/486
FirebasePerformance