简体   繁体   中英

Changing the main view using the NSUserDefaults and the settings bundle

I have a game on the App Store, and for the next version I am working on having an option in the settings to use different skin. So for example, lets say I choose the basketball option. I would want the app to show the basketball .xib instead of the default view controller.

How would I do that? There would be about 4-5 different skins. Thanks.

I would suggest doing your UI programmatically and not using a xib file as I believe it is impossible to accomplish what you are after with a xib.

If you are deadset on using a xib, create 5 identical sets of subviews and name them accordingly, then programmatically hide/unhide them when necessary.

This seems much more cumbersome and hard to manage when faced with an option of just creating the elements yourself in code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM