RSDChoiceOptions
public protocol RSDChoiceOptions : RSDChoicePickerDataSource
RSDChoiceOptions is a data source protocol that can be used to set up a picker or list of choices.
-
A list of choices for the input field.
Declaration
Swift
var choices : [RSDChoice] -
A Boolean value indicating whether the user can skip the input field without providing an answer.
Declaration
Swift
var isOptional: Bool
-
numberOfComponentsExtension methodReturns the number of ‘columns’ to display.
Declaration
Swift
public var numberOfComponents: Int -
numberOfRows(in:)Extension methodReturns the # of rows in each component.
Declaration
Swift
public func numberOfRows(in component: Int) -> IntParameters
componentThe component (or column) of the picker.
Return Value
The number of rows in the given component.
-
choice(forRow:forComponent:)Extension methodReturns the choice for this row/component. If this is returns
nilthen this is theskip
choice.Declaration
Swift
public func choice(forRow row: Int, forComponent component: Int) -> RSDChoice?Parameters
rowThe row for the selected component.
componentThe component (or column) of the picker.
-
selectedAnswer(with:)Extension methodReturns the selected answer created by the union of the selected rows.
Declaration
Swift
public func selectedAnswer(with selectedRows: [Int]) -> Any?Parameters
selectedRowsThe selected rows, where there is a selected row for each component.
Return Value
The answer created from the given array of selected rows.
-
selectedRows(from:)Extension methodReturns the selected rows that match the given selected answer (if any).
Declaration
Swift
public func selectedRows(from selectedAnswer: Any?) -> [Int]?Parameters
selectedAnswerThe selected answer.
Return Value
The selected rows, where there is a selected row for each component, or
nilif not all rows are selected. -
textAnswer(from:)Extension methodReturns the text answer to display for a given selected answer.
Declaration
Swift
public func textAnswer(from selectedAnswer: Any?) -> String?Parameters
selectedAnswerThe answer to convert.
Return Value
A text value for the answer to display to the user.
View on GitHub
RSDChoiceOptions Protocol Reference