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.