The purpose of CALayer?

I'm a little used to what the purpose of CALayer is. Why not just put the properties in a UIView?

Thanks.

+2
source share
1 answer

CALayer is a completely different thing from UIView. CALayer uses only drawing and encapsulating the information necessary for this. A view, on the other hand, has one or more layers that it uses to draw. There are many other functions and properties in a view that are not related to its presentation on the screen.

I would recommend delving into the Apple documentation, and perhaps compiling a book on object-oriented coding.

+4
source

All Articles