OptionItemSpec

open class OptionItemSpec : NSObject

The helper class to make option items.

  • The optional title assigned to a single choice option item.

    Important

    This property is used only for a SingleChoiceOptionItem.

    Declaration

    Swift

    public private(set) var title: String?
  • The input helper object assigned to a numeric option item.

    Important

    This property is used only for a NumericOptionItem.

    Declaration

    Swift

    public private(set) var inputHelper: NumericOptionItemInputHelper?
  • The type of the option item.

    Declaration

    Swift

    public private(set) var type: OptionItem.ItemType
  • The labels which are displayed.

    Declaration

    Swift

    public private(set) var labels: [String]
  • id

    The id of the option item.

    Declaration

    Swift

    public private(set) var id: Int
  • Makes an option item spec configured for a Boolean option item.

    Declaration

    Swift

    public static func makeBooleanOptionItem(label: String, id: Int = 0) -> OptionItemSpec

    Parameters

    label

    The string to be displayed.

    id

    The optional id of the option item.

    Return Value

    An OptionItemSpec instance created based on the parameter.

  • Makes an option item spec configured for a multiple choice option item.

    Declaration

    Swift

    public static func makeMultipleChoiceOptionItem(labels: [String], id: Int = 0) -> OptionItemSpec

    Parameters

    labels

    The strings to be displayed.

    id

    The optional id of the option item.

    Return Value

    An OptionItemSpec instance created based on the parameter.

  • Makes an option item spec configured for a numeric option item.

    Important

    By default the button is titled Set which is localized.

    Declaration

    Swift

    public static func makeNumericOptionItem(label: String, inputHelper: NumericOptionItemInputHelper, id: Int = 0) -> OptionItemSpec

    Parameters

    label

    The string to be displayed.

    inputHelper

    Provides all the input related helper parameters.

    id

    The optional id of the option item.

    Return Value

    An OptionItemSpec instance created based on the parameters.

  • Makes an option item spec configured for a single choice option item.

    Declaration

    Swift

    public static func makeSingleChoiceOptionItem(title: String?, labels: [String], id: Int = 0) -> OptionItemSpec

    Parameters

    title

    The optional title provided for the item

    labels

    The strings to be displayed.

    id

    The optional id of the option item.

    Return Value

    An OptionItemSpec instance created based on the parameters.

  • Makes an option item out of the option item spec.

    Declaration

    Swift

    public func makeOptionItem() -> OptionItem

    Return Value

    OptionItem instance created based on this spec.