TimeSelector
public struct TimeSelector
Defines a set of related time intervals and an optional way to generate labels to be displayed for them in a timeline diagram, computed according to the referenced selection logic.
-
Initializes a time selector, such as for highlighting in a timeline or for generating labels in a header row, based on an interval selector (that computes the time intervals to be selected) and an optional label generator (that would compute the textual values to be presented as labels for the selected time intervals).
Declaration
Swift
public init(intervalSelector: TimeIntervalSelector, labelGenerator: TimeLabelGenerator? = nil)
-
Selects time intervals to consider.
Declaration
Swift
public var intervalSelector: TimeIntervalSelector
-
Generates labels for the selected time intervals.
Declaration
Swift
public var labelGenerator: TimeLabelGenerator?
-
Allows selecting a style for any specific time area generated by the time selector by calling a client function with an argument of time interval type for that area.
Declaration
Swift
public var styleSelector: TimeAreaStyleSelector?
-
Default style for time areas generated by the time selector, used if a style selector is not set.
Declaration
Swift
public var style: TimeAreaStyle?
-
State information identifying the external context (such as a data object) that the item is associated to. Set it upon item construction to be able to use it within specific protocol function handlers that receive the item among arguments.
Declaration
Swift
public var context: Any?
-
Initializes a time selector based on specific time interval type.
Declaration
Swift
init(_ type: TimeIntervalType)
-
Initializes a time selector based on specific time interval type and format, using an optional locale and other arguments indicating whether to display interval labels rather than simple start labels and what separator string to place between end labels.
Declaration
Swift
init(_ type: TimeIntervalType, format: TimeLabelFormat, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil)
-
Initializes a time selector based on specific time interval type and format string, using an optional locale and other arguments indicating whether to display interval labels rather than simple start labels and what separator string to place between end labels.
Declaration
Swift
init(_ type: TimeIntervalType, format: String, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil)
-
Initializes a time selector based on specific time interval type and date and time styles, using an optional locale and other arguments indicating whether to display interval labels rather than simple start labels and what separator string to place between end labels.
Declaration
Swift
init(_ type: TimeIntervalType, dateStyle: DateFormatter.Style? = nil, timeStyle: DateFormatter.Style? = nil, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil)
-
Initializes a time selector based on specific time interval type and date formatter object, using other arguments indicating whether to display interval labels rather than simple start labels and what separator string to place between end labels.
Declaration
Swift
init(_ type: TimeIntervalType, formatter: DateFormatter, intervals: Bool? = nil, separator: String? = nil)
-
Initializes a time selector based on specific time interval type and associated label generator.
Declaration
Swift
init(_ type: TimeIntervalType, labelGenerator: TimeLabelGenerator?)
-
Undocumented
Declaration
Swift
static func labelGenerator(_ format: TimeLabelFormat, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil) -> TimeLabelGenerator
-
Undocumented
Declaration
Swift
static func labelGenerator(_ format: String, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil) -> TimeLabelGenerator
-
Undocumented
Declaration
Swift
static func labelGenerator(dateStyle: DateFormatter.Style? = nil, timeStyle: DateFormatter.Style? = nil, locale: Locale? = nil, intervals: Bool? = nil, separator: String? = nil) -> TimeLabelGenerator
-
Undocumented
Declaration
Swift
static func labelGenerator(_ formatter: DateFormatter, intervals: Bool? = nil, separator: String? = nil) -> TimeLabelGenerator
-
durationLabelGenerator(reference:in:schedule:zeroBased:includingNegativeValues:intervals:separator:)
Undocumented
Declaration
Swift
static func durationLabelGenerator(reference: Time? = nil, in unit: TimeUnit? = nil, schedule: ScheduleDefinition? = nil, zeroBased: Bool? = nil, includingNegativeValues: Bool? = nil, intervals: Bool? = nil, separator: String? = nil) -> TimeLabelGenerator
-
Undocumented
Declaration
Swift
static func formatter(_ format: String, locale: Locale? = nil) -> DateFormatter
-
Undocumented
Declaration
Swift
static func formatter(dateStyle: DateFormatter.Style? = nil, timeStyle: DateFormatter.Style? = nil, locale: Locale? = nil) -> DateFormatter
-
Undocumented
Declaration
Swift
static func formatter(_ locale: Locale? = nil) -> DateFormatter