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.
source share