RSDChoicePickerTableItemGroup
open class RSDChoicePickerTableItemGroup : RSDInputFieldTableItemGroup
RSDChoicePickerTableItemGroup subclasses RSDInputFieldTableItemGroup to implement a single or multiple
choice question where the choices are presented as a list.
-
Does the item group allow for multiple choices or is it single selection?
Declaration
Swift
public let singleSelection: Bool -
Default initializer.
Declaration
Swift
public init(beginningRowIndex: Int, inputField: RSDInputField, uiHint: RSDFormUIHint, choicePicker: RSDChoicePickerDataSource, answerType: RSDAnswerResultType? = nil)Parameters
beginningRowIndexThe first row of the item group.
inputFieldThe input field associated with this item group.
uiHintThe UI hint.
choicePickerThe choice picker data source.
answerTypeThe answer type.
-
Override to set the selected items.
Declaration
Swift
override open func setPreviousAnswer(from jsonValue: Any?) throws -
Override to set the selected items from the result.
Declaration
Swift
override open func setAnswer(from result: RSDResult) throws -
Declaration
Swift
open override func setDefaultAnswerIfValid() -> Bool -
Since the answer can be both
niland selected, override to check for selection state.Declaration
Swift
open override var isAnswerValid: Bool { get } -
Select or de-select an item (answer) at a specific indexPath. This is used for text choice and boolean answers.
Throws
RSDInputFieldErrorif the selection is invalid.Declaration
Swift
open func select(_ item: RSDChoiceTableItem, indexPath: IndexPath) throws -> (isSelected: Bool, reloadSection: Bool)Parameters
selectedA
Boolindicating if the item should be selected.indexPathThe IndexPath of the item.
Return Value
- isSelected: The new selection state of the selected item.
- reloadSection:
trueif the section needs to be reloaded b/c other answers have changed, otherwise returnsfalse.
View on GitHub
RSDChoicePickerTableItemGroup Class Reference