Reading the value of Target Device Family
Is it possible to determine what value has been set for Target Device Family from the code? I have two proj开发者_如何学Pythonect files that share the same sources and I would like to know which resources to load depending on what the project setting is. I could of course add a new value to the .plist files which are different for each project, but I'm trying to avoid any unnecessary settings.
Using UI_USER_INTERFACE_IDIOM will not work as that depends on what device is used.
Thanks.
No, the Target Device Family is a Project (and/or target) setting. Once the app is compiled and bundled, it's not visible anymore.
However, if you want to provide different versions of a resource file for the iPad / iPhone, you can use ~ipad
and ~iphone
suffixes for filenames.
E.g.:
image~ipad.png
image~iphone.png
精彩评论