Function

CGRectContainsPoint

Returns whether a rectangle contains a specified point.

Declaration

bool CGRectContainsPoint(CGRect rect, CGPoint point);

Parameters

rect

The rectangle to examine.

point

The point to examine.

Return Value

YES if the rectangle is not null or empty and the point is located within the rectangle; otherwise, NO.

Discussion

A point is considered inside the rectangle if its coordinates lie inside the rectangle or on the minimum X or minimum Y edge.

See Also

Checking for Membership

CGRectContainsRect

Returns whether the first rectangle contains the second rectangle.