1

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.

4

2 に答える 2

1

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.

于 2013-02-20T09:12:47.063 に答える
0

You only need QuartzCore.framework framework if you are using any classes of this framework.
And so UIView class is importing these framework.
P.S. importing a frmework doesn't mean that now you can use that framework. These frameworks are already in iOS you just import them so that you can suppress the compiler warnings and your project compiles successfully.

于 2013-02-20T09:17:03.557 に答える