---
title: "CGRectIntersectsRect(_:_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgrectintersectsrect(_:_:)"
---

# CGRectIntersectsRect(_:_:)

Returns whether two rectangles intersect.

## Declaration

```swift
func CGRectIntersectsRect(_ rect1: CGRect, _ rect2: CGRect) -> Bool
```

## Parameters

- `rect1`: The first rectangle to examine.
- `rect2`: The second rectangle to examine.

## Return Value

Return Value true if the two specified rectangles intersect; otherwise, false. The first rectangle intersects the second if the intersection of the rectangles is not equal to the null rectangle.

## See Also

### Comparing Values

- [CGRectEqualToRect(_:_:)](coregraphics/cgrectequaltorect(_:_:).md)
