How can I possibly use the rect argument passed in drawRect calls, am sure whenever setNeedsDisplayInRect is passed, drawRect method is called for particular region. for now I redraw the text and shapes for entire frame and not constraining to the rect part that needs to be redrawn and I have no idea on how effectively can I use the rect param.
Any insights on this will be helpful.
How can I possibly use the rect argument passed in drawRect calls, am sure
Share
The rect is the region to redraw. In some cases UIKit will redraw only a “dirty” region of your view. You can optimize your code to detect that some of the drawing would occur outside this rect by using
CGRectContainsPoint()and therefore not do it.