RSDChoicePickerDataSource

public protocol RSDChoicePickerDataSource : RSDPickerDataSource

A picker data source for selecting choices.

  • Returns the number of ‘columns’ to display.

    Declaration

    Swift

    var numberOfComponents: Int
  • Returns the # of rows in each component.

    Declaration

    Swift

    func numberOfRows(in component: Int) -> Int

    Parameters

    component

    The component (or column) of the picker.

    Return Value

    The number of rows in the given component.

  • Returns the choice for this row/component. If this is returns nil then this is the skip choice.

    Declaration

    Swift

    func choice(forRow row: Int, forComponent component: Int) -> RSDChoice?

    Parameters

    row

    The row for the selected component.

    component

    The component (or column) of the picker.

  • Returns the selected answer created by the union of the selected rows.

    Declaration

    Swift

    func selectedAnswer(with selectedRows: [Int]) -> Any?

    Parameters

    selectedRows

    The selected rows, where there is a selected row for each component.

    Return Value

    The answer created from the given array of selected rows.

  • Returns the selected rows that match the given selected answer (if any).

    Declaration

    Swift

    func selectedRows(from selectedAnswer: Any?) -> [Int]?

    Parameters

    selectedAnswer

    The selected answer.

    Return Value

    The selected rows, where there is a selected row for each component, or nil if not all rows are selected.