I read this example (link) ...
From the description, this seems to me a paradox:
When implementing a table view cell, there is tension between optimal scroll performance and optimal editing / reordering. You should usually use subviews in viewing the contents of a cell.
When you edit or reorder controls using subviews, it makes implementations and animations work better because UIKit does not need to be redrawn during the animation.
Conclusion: Subviews are faster because UIKit should not redraw during animation. Therefore, when scrolling, it should not call -drawRect: all the time. Right?
And then the paradox:
If the content is complex, however (more than three subzones), scroll performance may suffer. If this becomes a problem, you can instead draw directly in the sub-item a presentation of the contents of the table cell.
Conclusion: Prefer -drawRect: draw directly in the table view cell. Better scroll performance for complex cells. Better than a lot of sub-sectors.
So good. What is the truth? Subviews or -drawRect: which is better?
In my case, I would have 12 subzones per cell. Are they just trying to say that? "If you have only up to 3 subheadings, go with them, but if you have much more, use -drawRect: and draw directly on the cell." But then: why don't they always prefer -drawRect: then?
source share