RSDDurationRangeObject
public struct RSDDurationRangeObject : RSDDurationRange, RSDRangeWithFormatter, Codable
RSDDurationRangeObject extends the properties of an RSDInputField for a .duration data type.
-
The minimum allowed duration.
Declaration
Swift
public let minimumDuration: Measurement<UnitDuration> -
The maximum allowed duration. When the value of this property is
nil, there is no maximum.Declaration
Swift
public let maximumDuration: Measurement<UnitDuration>? -
A step interval to be used for a slider or picker in the smallest units represented.
Declaration
Swift
public let stepInterval: Int? -
The duration units that should be included in the formatter and picker used for setting up a
.durationdata type.Declaration
Swift
public let durationUnits: Set<UnitDuration> -
Formatterthat is appropriate to the data type. For a duration, the formatter is aDateComponentsFormatter.Declaration
Swift
public var formatter: Formatter? -
Default initializer for a
Decimalrange. This is used to initialize the range for aDecimaltype.Declaration
Swift
public init(durationUnits: Set<UnitDuration>? = nil, minimumDuration: Measurement<UnitDuration>? = nil, maximumDuration: Measurement<UnitDuration>? = nil, stepInterval: Int? = nil)Parameters
durationUnitsThe units that should be included in the formatter and picker. If
nilthen the the default will include all units.minimumDurationThe minimum allowed duration. If
nilthen the default will be0.maximumDurationThe maximum allowed duration.
stepIntervalA step interval to be used for a slider or picker in the smallest units represented.
-
Initialize from a
Decoder.- example:
{ "minimumValue" : 15, "maximumValue" : 360, "stepInterval" : 5, "unit" : "min", "durationUnits" : ["min", "hr"] }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
RSDDurationRangeObject Structure Reference