Skip to content

6j. Cell: Option

i_82 edited this page Mar 16, 2022 · 4 revisions

Option cell is a plain cell with disclosure indicator. It navigates user to a XUI pane with several option cells. User can select only 1 option.

Key Type Description Flags Default
options Array <Dictionary> option dictionary list Required -
footerText String footer text for the option pane Optional, Localizable ""
popoverMode Boolean present option pane as a popover Optional false
useChildIcon Boolean overrides icon, whether to use icon of selected option Optional false

options is an array contains option dictionary:

Key Type Description Flags Default
title String option title Required, Localizable -
value Any? option value Optional the same to title
shortTitle String displayed in detailTextLabel only if this option is selected Optional, Localizable the same to title
icon String option icon image name Optional nil

selectedOptionIndex means the indexPath.row of selected option cell.

value Type Description
Any? options[selectedOptionIndex]["value"]

Example

{
    "default": "Green; it's green!",
    "label": "List of Options",
    "cell": "Option",
    "key": "list-1",
    "options": [
        {
            "title": "Red; it's red!",
            "shortTitle": "Red"
        },
        {
            "title": "Green; it's green!",
            "shortTitle": "Green"
        },
        {
            "title": "Blue; great color!",
            "shortTitle": "Blue"
        }
    ]
}

Clone this wiki locally