Need to store user settings in your app?
Does these require default values?
Do you need a table view to display and modify these attributes?
If so, you need this component.
What it does -
✓ Provides one settings service singleton to your app.
✓ Read default values from an easily constructed PLIST file.
✓ Allows change of values, stores modified values in app's documents folder.
✓ Provides a UITableViewController that is dynamically built according to your PLIST.
✓ Supports UISwitch, UILabel, UITextField controls and custom view controllers.
✓ Easily customizable.
Provided an example source code that demonstrates the usage of Smart Settings.
What's Planned for Next Version
More improvements - conditional properties, will be able to set entries as hidden, they will be usable by app but hidden from display; also the ability to making an entry visible depending on different entry's value.
1) Edit the provided SettingsDefaults.plist, add all configuration entries you need for you app.
2) Create an instance of HSSettingsViewController and add it to your tab view controller under a UINavigationController.
settingsViewController = [[HSSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
navigationController = [[UINavigationController alloc] initWithRootViewController:settingsViewController];
[self.view addSubview:navigationController.view];
3) To read a configuration entry -
id value = [[HSSettingsService sharedService] getAttributeValueForSection:ATTRIBUTE_SECTION attributeIndex:ATTRIBUTE_ROW];
4) To set value and save-
[[HSSettingsService sharedService] setAttributeValue:ATTRIBUTE_VALUE forSectionIndex:ATTRIBUTE_SECTION attributeIndex:ATTRIBUTE_ROW];
[[HSSettingsService sharedService] save];
That's it, simple and easy.
Questions & Comments