Spotfire® Deployment Kit for Apple iOS

Defining keywords for dynamic configuration values

For all string type values in DeploymentKitApp > MyConfiguration, you can specify special keywords in the value string to cause the app to find the value in string resources or in settings. This task demonstrates specifying the title and icon for a custom menu item in the app's sidebar menu.

About this task

Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.
Note: You can customize most settings in Xcode, in DeploymentKitApp > MyConfiguration. Edit the key and value pairs in the Property List view. Optionally, you can edit the XML directly in the Source Code view. To work in the XML view, right click the file name, and then click Open As > Source Code.

Procedure

  1. Add your custom string resource entry to the appropriate DeploymentKitApp > Resources > Localizable > Localizable (lang) file.
    See The app strings for more information.
  2. Add your image file to Resources in the DeploymentKitApp project.
    See Modifying the app images for more information.
  3. In DeploymentKitApp > MyConfiguration, specify the string: and resource: keywords to indicate that those configuration values should be loaded from resources. See the example.
    Note: Likewise, you can specify the keyword setting:, as shown in the configuration example, and then specify the key name of an app setting value to use instead. Then the app looks up the setting value and substitutes it in place of the keyword when it evaluates the configuration value.

Example: defining a custom menu item

The following example demonstrates defining a custom menu item.

  1. In the app file Localizable.strings, we defined these string resources.
    "my_menuitem_icon1_filename" = "test_menuitem_icon1.png";
    "my_menuitem_icon1selected_filename" = "test_menuitem_icon1_active.png";
  2. In DeploymentKitApp > MyConfiguration, in the Property List view, find and expand the key labeled CustomMenuItems.
  3. Add the following entries.
    Key Type Value
    CustomMenuItems Array (2 items)
    Item 0 Dictionary (4 items)
    icon String string: my_menuitem_icon1_filename
    iconSelected String string: my_menuitem_icon1selected_filename
    title String setting: my_test_menuitem1_title
    url String https://spotfi.re
    Note: In the Source Code view, this section is displayed as follows.
    <dict>
       <key>icon</key>
       <string>string: my_menuitem_icon1_filename</string>
       <key>iconSelected</key>
       <string>string: my_menuitem_icon1selected_filename</string>
       <key>title</key>
       <string>setting: my_test_menuitem1_title</string>
       <key>url</key>
       <string>https://spotfi.re</string>
    </dict>
    
  4. In the Xcode project navigator, find and open DeploymentKitApp > Settings > Settings > Root.
  5. In the Property List view, find the setting Text Field - My Custom Menu Item Title.
    Key Type Value
    Item 19 (Text Field - My Custom Menu Item Title) Dictionary (4 items)
    Default Value String My Custom Menu Item 1
    Identifier String my_test_menuitem1_title
    Title String My Custom Menu Item Title
    Type String Text Field
    Note: In the Source Code view, this section is displayed as follows.
    <dict>
       <key>DefaultValue</key>
       <string>My Custom Menu Item 1</string>
       <key>Key</key>
       <string>my_test_menuitem1_title</string>
       <key>Title</key>
       <string>My Custom Menu Item Title</string>
       <key>Type</key>
       <string>PSTextFieldSpecifier</string>
    </dict>