Function

CGRectContainsRect

Returns whether the first rectangle contains the second rectangle.

Declaration

bool CGRectContainsRect(CGRect rect1, CGRect rect2);

Parameters

rect1

The rectangle to examine for containment of the rectangle passed in rect2.

rect2

The rectangle to examine for being contained in the rectangle passed in rect1.

Return Value

YES if the rectangle specified by rect2 is contained in the rectangle passed in rect1; otherwise, NO. The first rectangle contains the second if the union of the two rectangles is equal to the first rectangle.

See Also

Checking for Membership

CGRectContainsPoint

Returns whether a rectangle contains a specified point.

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