Using drawRect, setNeedsDisplay and layoutSubViews

Is there any basic rule for using methods like drawRect, setNeedsDisplay, and layoutSubViews? I believe that they negatively affect application performance. Are there any preferred alternatives for these posts?

+3
source share
1 answer

While this is not an exact duplicate of this question , I believe my answer there still applies.

Thus, it -drawRect:will redraw the content in the view, which is an expensive operation. Avoid redrawing, if you can, by breaking up the contents and moving or hiding these layers as needed.

, , , . .

+1

Source: https://habr.com/ru/post/1761098/


All Articles