简体   繁体   English

为app ios创建设置视图

[英]Creating a settings view for app ios

I would like to create a settings view within my app that so many apps today have implemented. 我想在我的应用程序中创建一个设置视图,这个视图已经实现了很多应用程序。 In the past, I have created a settings bundle which the users can modify there settings for my app by going into system settings. 在过去,我创建了一个设置包,用户可以通过进入系统设置来修改我的应用程序的设置。

My question is can I implement the .plist settings from the settings bundle into an ordinary view within my app? 我的问题是,我可以将设置包中的.plist设置实现到我应用中的普通视图吗? And if so, how is this done? 如果是这样,这是怎么做到的?

Thank you in advance 先感谢您

http://www.inappsettingskit.com/ does what you want. http://www.inappsettingskit.com/做你想要的。 The example that comes with the source code will be great resources to look at. 源代码附带的示例将是很好的资源。

The two major options you got are: 你得到的两个主要选择是:

  1. Create a PList within your project and assign key/value pairs and then create a ViewController that includes UISwitches, TextBoxes, Sliders, etc and then just use these controls to integrate with that PList. 在项目中创建一个PList并分配键/值对,然后创建一个包含UISwitches,TextBoxes,Sliders等的ViewController,然后使用这些控件与该PList集成。
  2. If you are talking less than 4-5 settings, use NSUserDefaults to store/read the values of these settings. 如果您说的设置少于4-5,请使用NSUserDefaults存储/读取这些设置的值。 You will still need to create a ViewController for the UI, but won't need a PList. 您仍然需要为UI创建ViewController,但不需要PList。

I personally like having settings within the app for most cases. 我个人喜欢在大多数情况下在应用程序中进行设置。 Legal statements, copyright notices and settings that won't be touched but once are probably better off using the SettingsBundle, but for settings that are updated or changed often should reside inside the app in my opinion. 法律声明,版权声明和设置不会被触及,但一旦使用SettingsBundle可能会更好,但对于经常更新或更改的设置应该在我看来应该驻留在应用程序内。

我想如果不保存大量数据,NSUserDefaults将是gr8选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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