How does iOS 7 implement the UI elements so that they look different depending on what SDK you compile with?

前端 未结 3 842
醉梦人生
醉梦人生 2021-02-02 00:21

There are elements like UITableViews, UINavigationBars that have a different style on iOS 7.

This style is determined at run time, since those

3条回答
  •  有刺的猬
    2021-02-02 00:27

    I can't be certain, but this is one guess about how it is done. Because they know what SDK version your app was linked against, they version out the framework on iOS 7 devices. So there is a hierarchy on the filesystem along the lines of /.../iPhoneOS6.1.sdk/.../Frameworks/UIKit. Then when it loads your app, they can just set the search path for libraries to point to whichever SDK your app was linked against.

    This is how Xcode does it right now. Inside the Developer directory inside the Xcode package is an SDKs directory, which, in turn, contains all the different SDKs to link against.

提交回复
热议问题