Instance Method

intersects(_:)

Returns a Boolean value indicating whether two rectangles intersect each other.

Declaration

func intersects(_ rect2: MKMapRect) -> Bool

Parameters

rect1

The first rectangle to test.

rect2

The second rectangle to test.

Return Value

true if rect1 and rect2 intersect each other or false if they do not intersect or either rectangle is null.

Discussion

The rectangles are not considered to be intersecting if the only intersection occurs along an edge. To be considered a true intersection, the rectangles must both enclose a single rectangular area whose width and height are both greater than 0.

See Also

Intersecting the Rectangle

func contains(MKMapPoint) -> Bool

Returns a Boolean value indicating whether the specified map point lies within the rectangle.

func contains(MKMapRect) -> Bool

Returns Boolean value indicating whether one rectangle contains another.