VOPreference 0.1.0

VOPreference 0.1.0

Maintained by Valo Lee.



  • By
  • pozi119

VOPreference

CI Status Version License Platform

Feature

  • Group header, group footer
  • Text
  • Multiple Values
  • TextField
  • ToggleSwitch
  • Slider
  • Button
  • Stepper with value
  • Date/Time Picker
  • Segmented control
  • Segmented Slider

Usage

  1. 使用XCode文件模板,添加setting.bundle
  2. 拷贝setting.bundle中的plist文件到项目中
  3. 使用代码创建并跳转设置页面,示例如下:
    NSString *path = [[NSBundle mainBundle] pathForResource:@"manual" ofType:@"plist"];
    VPSetting *setting = [[VPSetting alloc] initWithEntiresFile:path];
    VOPreferenceController *settingVC = [[VOPreferenceController alloc] init];
    settingVC.setting = setting;
    [self.navigationController pushViewController:settingVC animated:YES];

Note

默认使用 NSUserDefaults 保存配置, 也可以设置为其他方式保存.

    [setting setValueForEntryKey:^id(NSString * entryKey) {
        // load val for entryKey
    }];
    [setting setSetValueForEntryKey:^(NSString *  entryKey, id val) {
        // save val for entryKey
    }];

Requirements

Installation

VOPreference is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'VOPreference'

Author

pozi119, [email protected]

License

VOPreference is available under the MIT license. See the LICENSE file for more info.