RSDNumberRangeObject
public struct RSDNumberRangeObject : RSDNumberRange, Codable
RSDNumberRangeObject extends the properties of an RSDInputField for a decimal or integer data type.
-
The minimum allowed number. When the value of this property is
nil, there is no minimum.Declaration
Swift
public let minimumValue: Decimal? -
The maximum allowed number. When the value of this property is
nil, there is no maximum.Declaration
Swift
public let maximumValue: Decimal? -
A step interval to be used for a slider or picker.
Declaration
Swift
public let stepInterval: Decimal? -
A unit label associated with this property. The unit should not be localized. Instead, this value is used to determine the unit for measurements converted to the unit expected by the researcher.
For example, if a measurement of distance is displayed and/or returned by the user in feet, but the researcher expects the returned value in meters then the unit here would be
m
and the formatter would be aLengthFormatterthat uses the current locale with aunitStyleof.long.Declaration
Swift
public let unit: String? -
Formatterthat is appropriate to the data type. Ifnil, the format will be determined by the UI. This is the formatter used to display a previously entered answer to the user or to convert an answer entered in a text field into the appropriate value type.Note
Currently, theCodableprotocol only supports instantiating aNumberFormatterwith amaximumDigits
key that contains the number of decimal places to display.Declaration
Swift
public let formatter: Formatter? -
Default initializer for a
Decimalrange. This is used to initialize the range for aDecimaltype.Declaration
Swift
public init(minimumDecimal: Decimal?, maximumDecimal: Decimal?, stepInterval: Decimal? = nil, unit: String? = nil, formatter: Formatter? = nil)Parameters
minimumDecimalThe minimum allowed number.
maximumDecimalThe maximum allowed number.
stepIntervalA step interval to be used for a slider or picker. Default =
nil.unitA unit label associated with this property. Default =
nil.formatterNumberFormatterthat is appropriate to the data type. Default =nil. -
Default initializer for an
Intrange. This is used to initialize the range for anInttype.Declaration
Swift
public init(minimumInt: Int?, maximumInt: Int?, stepInterval: Int? = nil, unit: String? = nil, formatter: Formatter? = nil)Parameters
minimumIntThe minimum allowed number.
maximumIntThe maximum allowed number.
stepIntervalA step interval to be used for a slider or picker. Default =
nil.unitA unit label associated with this property. Default =
nil.formatterNumberFormatterthat is appropriate to the data type. Default =nil. -
Default initializer for an
Doublerange. This is used to initialize the range for aDoubletype.Declaration
Swift
public init(minimumDouble: Double?, maximumDouble: Double?, stepInterval: Double? = nil, unit: String? = nil, formatter: Formatter? = nil)Parameters
minimumDoubleThe minimum allowed number.
maximumDoubleThe maximum allowed number.
stepIntervalA step interval to be used for a slider or picker. Default =
nil.unitA unit label associated with this property. Default =
nil.formatterNumberFormatterthat is appropriate to the data type. Default =nil. -
Initialize from a
Decoder.Throws
DecodingErrorDeclaration
Swift
public init(from decoder: Decoder) throwsParameters
decoderThe decoder to use to decode this instance.
-
Encode the object to the given encoder.
Throws
EncodingErrorDeclaration
Swift
public func encode(to encoder: Encoder) throwsParameters
encoderThe encoder to use to encode this instance.
View on GitHub
RSDNumberRangeObject Structure Reference