MomentPeriodSelector

public struct MomentPeriodSelector : TimeIntervalSelector

Generates momentary or extended time intervals for (or separated by) specific (or the current) date-time value(s).

  • Undocumented

    Declaration

    Swift

    public init(for times: [Time]? = nil, separating: Bool = false)
  • Undocumented

    Declaration

    Swift

    public init(for time: Time, separating: Bool = false)
  • Optionally sets a collection of times to be used as moments or to separate the returned time intervals. When it is not set, the current time value will be used instead.

    Declaration

    Swift

    public var times: [Time]?
  • Indicates whether to return extended time intervals separated by the specified times rather than simple moments.

    Declaration

    Swift

    public var separating: Bool
  • Returns specific moments or extended intervals separated by the specified times within the input interval. When no moments are actually specified (the times array is not set), it uses the current time value instead.

    Declaration

    Swift

    public func times(in interval: TimeRange) -> [TimeRange]