RSDDurationPickerDataSourceObject
public struct RSDDurationPickerDataSourceObject : RSDMultipleComponentPickerDataSource
RSDDurationPickerDataSourceObject
is a concrete implementation of a RSDMultipleComponentChoiceOptions
that can be used to select a duration using duration units for each component of the duration.
-
A list of choices for the input field.
Declaration
Swift
public var choices: [[RSDChoice]] { get }
-
The separator is not used with the height picker.
Declaration
Swift
public let separator: String?
-
The default answer associated with this option set.
Declaration
Swift
public let defaultAnswer: Any?
-
Default initializer.
Declaration
Swift
public init?(range: RSDDurationRange)
Parameters
range
The duration range to use to instantiate this picker source.
-
Returns the selected answer created by the union of the selected rows.
Declaration
Swift
public func selectedAnswer(with selectedRows: [Int]) -> Any?
Parameters
selectedRows
The selected rows, where there is a selected row for each component.
Return Value
The answer created from the given array of selected rows.
-
Returns the selected rows that match the given selected answer (if any).
Declaration
Swift
public func selectedRows(from selectedAnswer: Any?) -> [Int]?
Parameters
selectedAnswer
The selected answer.
Return Value
The selected rows, where there is a selected row for each component, or
nil
if not all rows are selected. -
Returns the text answer to display for a given selected answer.
Declaration
Swift
public func textAnswer(from selectedAnswer: Any?) -> String?
Parameters
selectedAnswer
The answer to convert.
Return Value
A text value for the answer to display to the user.
-
The duration measurement (if any) for the given answer.
Declaration
Swift
public func duration(for answer: Any?) -> Measurement<UnitDuration>?
Parameters
answer
The object to convert to a duration measurement.
Return Value
The duration measurement (if any).