You can do this with drawViewHierarchyInRect: none of the other methods work, use it like this:
UIGraphicsBeginImageContextWithOptions(newRect.size, YES, 0); BOOL ok = [view drawViewHierarchyInRect:newRect afterScreenUpdates:YES]; if (!ok) { NSLog(@"Problem with drawView..."); } UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
I do the same in iOS, but unfortunately this method is slow, it should also be run in the main thread and only works if afterScreenUpdates is set to yes. See This Answer: How to take a snapshot of a UIView that is not showing?
There is also no way to tell what I see if any aspect of the web page needs to be redrawn.
source share