Does setNeedsDisplay have an immediate effect or is it just queued for later?

Does anyone know if setNeedsDisplay immediate drawRect call and an immediate screen refresh? Or is it just a queued request? Thanks.

+4
source share
1 answer

The view does not actually redraw until the next drawing cycle. It simply notifies the system that the view should be redrawn.

See UIView Class Reference

Apparently you can accomplish this by setting the content mode to UIViewContentModeRedraw . I did not do it personally, but the code should be something like lines

 UIView *redrawView = [[UIView alloc] initWithFrame:frame]; ... redrawView.contentMode = UIViewContentModeRedraw; 

See View and Window Modes: Content Modes

+4
source

All Articles