I use this code to upload files. The problem is that the loading animation in progrssView
done at the last moment. And not during the whole process. How to solve a problem?
I use NSURLSession as advised in the previous question.
- (void)viewDidLoad { _progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; _progressView.progressTintColor = [UIColor colorWithRed:0.0/255 green:0.0/255 blue:0.0/255 alpha:0.4]; [[_progressView layer]setFrame:CGRectMake(60, 150, 100, 25)]; [[_progressView layer]setBorderColor:[UIColor whiteColor].CGColor]; _progressView.trackTintColor = [UIColor clearColor]; [_progressView setProgress:(float)(50/100) animated:YES]; [[_progressView layer]setCornerRadius:_progressView.frame.size.width / 8]; [[_progressView layer]setBorderWidth:1]; [[_progressView layer]setMasksToBounds:TRUE]; _progressView.clipsToBounds = YES; [self.view addSubview:_progressView]; _session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue mainQueue]]; [self.progressView setProgress:0 animated:NO]; }