RSDInputFieldTableItemGroup

open class RSDInputFieldTableItemGroup : RSDTableItemGroup

RSDInputFieldTableItemGroup is used to represent a single input field.

  • The input field associated with this item group.

    Declaration

    Swift

    public let inputField: RSDInputField
  • The UI hint for displaying the component of the item group.

    Declaration

    Swift

    public let uiHint: RSDFormUIHint
  • The answer type for the input field result.

    Declaration

    Swift

    public let answerType: RSDAnswerResultType
  • Does this item group require an exclusive section?

    Declaration

    Swift

    public let requiresExclusiveSection: Bool
  • Default initializer.

    Declaration

    Swift

    public init(beginningRowIndex: Int, items: [RSDTableItem], inputField: RSDInputField, uiHint: RSDFormUIHint, answerType: RSDAnswerResultType, requiresExclusiveSection: Bool? = nil)

    Parameters

    beginningRowIndex

    The first row of the item group.

    items

    The table items included in this item group.

    inputField

    The input field associated with this item group.

    uiHint

    The UI hint.

    answerType

    The answer type.

  • Convenience initializer.

    Declaration

    Swift

    public init(beginningRowIndex: Int, tableItem: RSDTextInputTableItem)

    Parameters

    beginningRowIndex

    The first row of the item group.

    tableItem

    A single table item that can be used to build an answer.

  • Convenience property for accessing the identifier associated with the item group.

    Declaration

    Swift

    public var identifier: String { get }
  • The answer for this item group. This is the answer stored to the RSDAnswerResult. The default implementation will return the privately stored answer if set and if not, will look to see if the first table item is recognized as a table item that stores an answer on it.

    Declaration

    Swift

    open var answer: Any? { get }
  • Set the new answer value. This will throw an error if the value isn’t valid. Otherwise, it will set the answer.

    Throws

    RSDInputFieldError if the answer is invalid.

    Declaration

    Swift

    open func setAnswer(_ newValue: Any?) throws

    Parameters

    newValue

    The new value for the answer.

  • Set the answer from a previous run to the given value.

    Declaration

    Swift

    open func setPreviousAnswer(from jsonValue: Any?) throws
  • Set the default answer for the item group. The base class implementation does nothing.

    Declaration

    Swift

    open func setDefaultAnswerIfValid() -> Bool

    Return Value

    true if the answer was updated and false if the answer was unchanged.

  • Set the new answer value from a previous result. This will throw an error if the result isn’t valid. Otherwise, it will set the answer.

    Throws

    RSDInputFieldError if the answer is invalid.

    Declaration

    Swift

    open func setAnswer(from result: RSDResult) throws

    Parameters

    result

    The result that may have a previous answer.

  • Determine if the current answer is valid. Also checks the case where answer is required but one has not been provided.

    Declaration

    Swift

    open override var isAnswerValid: Bool { get }

    Return Value

    A Bool indicating if answer is valid.

  • Whether or not the question is optional.

    Declaration

    Swift

    open var isOptional: Bool { get }