UIProgressView custom track and progress images in iOS 7.1

This is very annoying. I didn’t find a way to fix this without subclassing UIProgressView. Anyway here’s how I fixed this: https://gist.github.com/JohnEstropia/9482567 You will have to change occurrences of UIProgressView to JEProgressView, including those in NIBs and storyboards. Basically, you’d need to force assigning the images directly to the UIProgressView‘s children UIImageViews. The subclass is … Read more

How to use UIProgressView while loading of a UIWebView?

UIWebView doesn’t give you any progress information in the normal mode. What you need to do is first fetch your data asynchronously using an NSURLConnection. When the NSURLConnection delegate method connection:didReceiveResponse, you’re going to take the number you get from expectedContentLength and use that as your max value. Then, inside the delegate method connection:didReceiveData, you’re … Read more

Objective C: Downloading File With Progress Bar [duplicate]

Using AFNetworking, here progress is the UIProgressview #import <AFNetworking/AFNetworking.h>//add to the header of class -(void)downloadShowingProgress { progress.progress = 0.0; currentURL=@”http://www.selab.isti.cnr.it/ws-mate/example.pdf”; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:currentURL]]; AFURLConnectionOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@”MY_FILENAME_WITH_EXTENTION.pdf”]; operation.outputStream = [NSOutputStream outputStreamToFileAtPath:filePath append:NO]; [operation setDownloadProgressBlock:^(NSUInteger bytesRead, NSUInteger totalBytesRead, NSUInteger … Read more