开发者

Purpose of CALayer?

开发者 https://www.devze.com 2023-01-02 15:36 出处:网络
I\'m slightly used as to what the purpose of CALayer\'s existence is. Why n开发者_Python百科ot just put the properties in a UIView?

I'm slightly used as to what the purpose of CALayer's existence is. Why n开发者_Python百科ot just put the properties in a UIView?

Thanks.


A CALayer represents a completely different "thing" from a UIView. A CALayer only deals with drawing itself, and encapsulating the information needed to do that. A view, on the other hand, owns one or many layers, which it uses to draw itself. A view has many other functions and properties though, that are unrelated to its representation on the screen.

I would recommend digging into the Apple documentation, and maybe picking up a book on Object Oriented coding.

0

精彩评论

暂无评论...
验证码 换一张
取 消