---
title: "CGRectContainsPoint(_:_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgrectcontainspoint(_:_:)"
---

# CGRectContainsPoint(_:_:)

Returns whether a rectangle contains a specified point.

## Declaration

```swift
func CGRectContainsPoint(_ rect: CGRect, _ point: CGPoint) -> Bool
```

## Parameters

- `rect`: The rectangle to examine.
- `point`: The point to examine.

## Return Value

Return Value true if the rectangle is not null or empty and the point is located within the rectangle; otherwise, false.

## Discussion

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(_:_:)](coregraphics/cgrectcontainsrect(_:_:).md)
