MortimerGoro / MGSwipeTableCell

An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.
MIT License
6.96k stars 1.07k forks source link

Resolves #363 Visual glitch/flash on refreshContentView() while cell is swiped open #364

Closed drewster99 closed 2 years ago

drewster99 commented 2 years ago

Specifically, when refreshContentView() is called, a new UIImage snapshot of the cell's content view is created using the older - (BOOL)drawViewHierarchyInRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates with UIGraphicsBeginImageContextWithOptions. In order to cause the new content to be rendered, afterUpdates must be YES, which causes the user's screen to redraw in order to make the latest content available.

Changed - (UIImage *)imageFromView:(UIView *)view cropSize:(CGSize)cropSize to use UIGraphicsRenderer and - (void)renderInContext:(CGContextRef)ctx instead, eliminating the need to draw a view update to the screen.

Resolves https://github.com/MortimerGoro/MGSwipeTableCell/issues/363

MortimerGoro commented 2 years ago

Thanks for looking into this. I have tested it and LGTM!