简体   繁体   中英

InAppSettingsKit with multiple plists

I am looking for a pretty advanced settings framework for iOS.

First, I would like to use custom editors for some settings (user can select colors). If I read correctly, this is feasible with IASK.

I have not found a answer though for my second issue.

Our app is fairly broad with 3 or 4 different "areas" and we would like to have settings on an "area" basis. This is definitely not possible with standard settings but is it possible with IASK?

This could be either thru different plist or different Childpanes in the same plist but then it would require being able to start the editor from a given Childpane.

Many thanks for your answer.

Custom editors are definitely possible using IASKCustomViewSpecifier (see the Readme).

Regarding the areas, I'm not sure if 1) the areas are structurally the same and you just want to store the user settings separately, or if 2) they are completely different.

  1. If your areas have the same set of settings and you just want to store them separately, you can use separate subclasses of IASKAbstractSettingsStore . If you want to store all settings in NSUserDefaults you can subclass IASKSettingsStoreUserDefaults instead.

    In the implementation you can either use different NSUserDefaults instances (instead of standardUserDefaults ). Then your subclass would just need to override -init and store a different NSUserDefaults instance in the defaults property.

    Alternatively, you can use a prefix to the settings key. For this you'd have to override all setters and getters to insert your prefix.

  2. If you're merely interested in having separate settings screens with different settings, you can instantiate one IASKAppSettingsViewController instance for each area and set the file property to the name of the settings plist for each area. The same mechanism is used internally for child panes, so you could also add a parent page with PSChildPaneSpecifier s for each area. This would even work with the system settings.

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