intersects
TypeScriptintersects(dateInterval: DateInterval): booleanSwift declarationfunc intersects(_ dateInterval: DateInterval) -> BoolIndicates whether this interval intersects the specified interval.
struct · iOS 10.0+ · SDK 27.1
struct DateIntervalThe span of time between a specific start date and end date. `DateInterval` represents a closed date interval in the form of [startDate, endDate]. It is possible for the start and end dates to be the same with a duration of 0. `DateInterval` does not support reverse intervals i.e. intervals where the duration is less than 0 and the end date occurs earlier in time than the start date.
intersects(dateInterval: DateInterval): booleanSwift declarationfunc intersects(_ dateInterval: DateInterval) -> BoolIndicates whether this interval intersects the specified interval.
get description(): stringSwift declarationvar description: String { get }A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.
get customMirror(): SDKHandleSwift declarationvar customMirror: Mirror { get }The custom mirror for this instance. If this type has value semantics, the mirror should be unaffected by subsequent mutations of the instance.
intersection(dateInterval: DateInterval): (DateInterval) | nullSwift declarationfunc intersection(with dateInterval: DateInterval) -> DateInterval?Returns an interval that represents the interval where the given date interval and the current instance intersect. In the event that there is no intersection, the method returns `nil`.
get debugDescription(): stringSwift declarationvar debugDescription: String { get }A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.
get end(): globalThis.DateSwift declarationvar end: Date { get set }The end date. - Precondition: `end >= start`
set end(value: globalThis.Date)Swift declarationvar end: Date { get set }The end date. - Precondition: `end >= start`
static initStartEnd(start: globalThis.Date, end: globalThis.Date): DateIntervalSwift declarationinit(start: Date, end: Date)Initializes an interval with the specified start and end date. - Precondition: `end >= start`
static initStartDuration(start: globalThis.Date, duration: number): DateIntervalSwift declarationinit(start: Date, duration: TimeInterval)Initializes an interval with the specified start date and duration. - Precondition: `duration >= 0`
get start(): globalThis.DateSwift declarationvar start: DateThe start date.
set start(value: globalThis.Date)Swift declarationvar start: DateThe start date.
compare(dateInterval: DateInterval): ComparisonResultSwift declarationfunc compare(_ dateInterval: DateInterval) -> ComparisonResultCompares two intervals. This method prioritizes ordering by start date. If the start dates are equal, then it will order by duration. e.g. Given intervals a and b ``` a. |-----| b. |-----| ``` `a.compare(b)` would return `.orderedAscending` because a's start date is earlier in time than b's start date. In the event that the start dates are equal, the compare method will attempt to order by duration. e.g. Given intervals c and d ``` c. |-----| d. |---| ``` `c.compare(d)` would result in `.orderedDescending` because c is longer than d. If both the start dates and the durations are equal, then the intervals are considered equal and `.orderedSame` is returned as the result.
contains(date: globalThis.Date): booleanSwift declarationfunc contains(_ date: Date) -> BoolIndicates whether this interval contains the given date.
get duration(): numberSwift declarationvar duration: TimeInterval { get set }The duration. - Precondition: `duration >= 0`
set duration(value: number)Swift declarationvar duration: TimeInterval { get set }The duration. - Precondition: `duration >= 0`
static init(): DateIntervalSwift declarationinit()Initializes an interval with start and end dates set to the current date and the duration set to `0`.
No declarations were skipped in this snapshot.