Skip to content

Commit

Permalink
Fix quality loss in snapshot image
Browse files Browse the repository at this point in the history
  • Loading branch information
vox-humana committed Feb 13, 2018
1 parent a08fdd0 commit 5b5369a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,8 @@ -(UIView *) hitTest:(CGPoint)point withEvent:(UIEvent *)event
#pragma mark Some utility methods

- (UIImage *)imageFromView:(UIView *)view cropSize:(CGSize)cropSize{
UIGraphicsBeginImageContextWithOptions(cropSize, NO, [[UIScreen mainScreen] scale]);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsBeginImageContextWithOptions(cropSize, NO, 0);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
Expand Down

0 comments on commit 5b5369a

Please sign in to comment.