These are all the details of Apple's implementation, so I don’t know for sure. In addition, different presentation classes will have different relationships with their layer.
For example, UIImageView explicitly documented so as not to invoke drawRect:. This is probably due to the fact that setting the image actually updates the layer property contentsdirectly, without going through rendering methods.
However, I believe that the main behavior UIViewis that it setNeedsDisplaysimply redirects the call to this level. Then, when the view is invoked drawLayer:inContext:, it adjusts the contents of the context UIGraphicsand invokes drawRect:.
source
share