This story is unavailable.

Nice tutorial Kyle Stewart. But I am running into a problem. NSURLSession’s delegate method has a weird behaviour . I am uploading a video (multipart) and want to show upload progress in progress bar but below method get called before completion block of upload task.

- (void)URLSession:(NSURLSession *)session

task:(NSURLSessionTask *)task

didSendBodyData:(int64_t)bytesSent

totalBytesSent:(int64_t)totalBytesSent

totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend

{

dispatch_async(dispatch_get_main_queue(), ^{

NSLog(@”upload progress :%f”,(double)totalBytesSent /(double)totalBytesExpectedToSend);

});

}

Can you suggest some solution ?