Search code examples
iosswiftxcodesettings-bundleios-settings-bundle

Change the title string of a setting defined via iOS settings bundle at run time?


I'm working on an iPad application that allows users to log in using Touch ID. Also I've included a preference called "Touch ID" in application settings bundle where users can switch on/off that option to enable or disable Touch ID authentication.

The following plist file is what I used to set up the settings bundle.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>StringsTable</key>
    <string>Root</string>
    <key>PreferenceSpecifiers</key>
    <array>
        <dict>
            <key>Type</key>
            <string>PSToggleSwitchSpecifier</string>
            <key>Title</key>
            <string>Touch ID</string>
            <key>Key</key>
            <string>settingsTouchID</string>
            <key>DefaultValue</key>
            <false/>
        </dict>
    </array>
</dict>
</plist>

The following image is the screenshot of the application settings screen.

App settings screen

However, certain iPads feature "Face ID" instead of "Touch ID," and I'd like to provide the option name (title field in the Plist file) for setting bundle to "Face ID" instead of "Touch ID" for those devices.

Could someone kindly inform me if dynamic titles for the application settings options are possible? 

Note: I have got some alternative solutions like, creating a settings screen within my app itself, renaming the setting name to a generic one, etc.


Solution

  • there is no way to edit plist files at run time