Search code examples
iosuiviewuikitcore-animationcalayer

Why UIView doesn't need QuartzCore.framework to work?


I realized that every views are backed up by a CALayer. So I was wondering why when we use UIView we don't need to import QuartzCore.framework in our project ?

I know we need to do it if we need to set properties like shadowOffset for example but I'm sure in its own implementation need to set these properties.

Thanks for your answers.


Solution

  • Because you are not accessing any CALayer properties or methods directly unless you change the properties of the UIView's layer. Internally, UIView uses it.

    EDIT The reason that you don't need to link it just to use UIView is because UIView is an already compiled library. All of the symbols inside have already been resolved (or flagged as weak a.k.a. to be resolved at runtime) and so the compiler and linker just use them as they are.