Returns the intersection between the receiver and the specified date interval.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
The date interval with which to calculate the intersection of the receiver.
A date interval for the intersection of the receiver and
nil if no intersection occurs.
Calculating the intersection of date intervals is a commutative and associative operation. The intersection of a date interval with itself is equal to itself.
The following figure illustrates five
NSDate objects plotted on an arbitrary time axis. Each date interval spans its
duration from left to right, from its
start to its
The date intervals labeled A and B do not intersect, because the
start of B occurs later than the
end of A.
The date intervals labeled C and D do intersect. The date interval labeled E represents the result of calculating the intersection between C and D.