RSDHeightInputTableItem

public final class RSDHeightInputTableItem : RSDTextInputTableItem

A custom implementation for inputing a person’s height that can set up a picker for setting the height of an adult. Typically, US participants will report an adult height using ft and in, whereas a child or infant will be reported in inches. The placeholder text for child or infant measurement range will be either inches or centimeters, depending upon the participant’s locale.

  • The base unit is the unit of mass that the measurement should be converted to in order to save the result. Because the Measurement class has a generic UnitType, it cannot be easily converted to a Codable object so the results are stored as .decimal base type with the unit symbol also stored on the result.

    Declaration

    Swift

    public let baseUnit: UnitLength
  • Default initializer.

    Declaration

    Swift

    public init(rowIndex: Int, inputField: RSDInputField, uiHint: RSDFormUIHint, measurementSize: RSDFormDataType.MeasurementRange)

    Parameters

    rowIndex

    The index of this item relative to all rows in the section in which this item resides.

    inputField

    The RSDInputField representing this tableItem.

    uiHint

    The UI hint for this row of the table.

    measurementSize

    The measurement range for the input field.

  • Override the convertAnswer() function to convert the Measurement returned by the formatter into a decimal value in the baseUnit.

    Declaration

    Swift

    override public func convertAnswer(_ newValue: Any) throws -> Any?