Search code examples
iosuitableviewinappsettingskit

Call my own cellForRowAtIndexPath for PSMultiValueSpecifier cell


Using InAppSettingsKit (2.8 branch), how should I implement my own cellForRowAtIndexPath for that kind of setting's type (PSMultiValueSpecifier) ?

    <dict>
        <key>DefaultValue</key>
        <integer>0</integer>
        <key>Key</key>
        <string>theme</string>
        <key>Title</key>
        <string>Theme</string>
        <key>Titles</key>
        <array>
            <string>Light</string>
            <string>Dark</string>
        </array>
        <key>Type</key>
        <string>PSMultiValueSpecifier</string>
        <key>Values</key>
        <array>
            <integer>0</integer>
            <integer>1</integer>
        </array>
    </dict>

I need to reconfigure all the cell to apply the current theme but I can't find a way to subclass (or provide the name of a subclass) to the IASKSpecifierValuesViewController used to display the different choices on setting of type "PSMultiValueSpecifier"

Thanks!


Solution

  • The best way to accomplish this is by subclassing IASKSpecifierValuesViewController and using your subclass as a custom view controller. Of course you have to assign the currentSpecifier, settingsReader and settingsStore when the user selects the custom child pane by implementing the delegate method settingsViewController:tableView:didSelectCustomViewSpecifier:. Take a look at IASKAppSettingsViewController.m:711-718 to see what needs to be done.