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.
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
withUIGraphicsBeginImageContextWithOptions
. In order to cause the new content to be rendered,afterUpdates
must beYES
, 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 useUIGraphicsRenderer
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