You can create thumbnails of your UIWebViews by using :
UIView *newView = [view snapshotViewAfterScreenUpdates:YES];
or you can use as well :
UIGraphicsBeginImageContextWithOptions(myView.bounds.size, NO, 0);
[myView drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Important! if you want to create a thumbnail of an UIWebView, you can find problems like, you take the screenshot and the page hasnt been loaded completely, so I would recommend to you do it when the page has been loaded or, as I had to do, put a javascript flag to call iOS natively and take the screenshot in this particular moment. You can save the thumbnails, store them using the mechanism you want (coredata for example and have a persistent database to access the information fastly) or you can use a configuration file with the paths to the internal folder inside the application, it´s really up to you. But bear in mind about "when" the UIWebView has loaded the content because sometimes, we take the screenshot and there is nothing in the view and you will get all the time a blank page.
Instead of taking the screenshot in : webView:shouldStartLoadWithRequest:navigationType: take it in webViewDidFinishLoad: but bear in mind, it doesnt mean the webpage has been loaded correctly! You can have an ajax event or an external javascript event that uploads content in the screen but the UIWebView can say it has been loaded when it hasnt! so thats the reason to use a javascript flag to call natively an internal function to take the screenshot.
Once you have the screenshot, you will have to resize it to have your thumbnail image. For example, you can use :
+ (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
//UIGraphicsBeginImageContext(newSize);
// In next line, pass 0.0 to use the current device's pixel scaling factor (and thus account for Retina resolution).
// Pass 1.0 to force exact pixel size.
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
(solution found in The simplest way to resize an UIImage?)
But there are several ways to do it. The best in my opinion is to add a category and adapt the functionality in the way you want.
Hope it helps