How to capture UIView to UIImage without loss of quality on retina display

The currently accepted answer is now out of date, at least if you are supporting iOS 7. Here is what you should be using if you are only supporting iOS7+: + (UIImage *) imageWithView:(UIView *)view { UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0f); [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; UIImage * snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return snapshotImage; } Swift 4: func imageWithView(view: … Read more