Function

CGRectIntersectsRect

Returns whether two rectangles intersect.

Declaration

bool CGRectIntersectsRect(CGRect rect1, CGRect rect2);

Parameters

rect1

The first rectangle to examine.

rect2

The second rectangle to examine.

Return Value

YES if the two specified rectangles intersect; otherwise, NO. The first rectangle intersects the second if the intersection of the rectangles is not equal to the null rectangle.

See Also

Comparing Values

CGPointEqualToPoint

Returns whether two points are equal.

CGSizeEqualToSize

Returns whether two sizes are equal.

CGRectEqualToRect

Returns whether two rectangles are equal in size and position.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software