Instance Method
intersection(with:)
iOS 10.0+
iPadOS 10.0+
Mac Catalyst 10.0+
macOS 10.12+
tvOS 10.0+
watchOS 3.0+
Returns an interval that represents the interval where the given date interval and the current instance intersect.
func intersection(with dateInterval: DateInterval) -> DateInterval?
Discussion
In the event that there is no intersection, the method returns nil.