<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGRectIntersectsRect(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGRectIntersectsRect"
  },
  "title" : "CGRectIntersectsRect(_:_:)"
}
-->

# CGRectIntersectsRect(_:_:)

Returns whether two rectangles intersect.

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

## Parameters

`rect1`

The first rectangle to examine.

`rect2`

The second rectangle to examine.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the two specified rectangles intersect; otherwise, <doc://com.apple.documentation/documentation/Swift/false>. The first rectangle intersects the second if the intersection of the rectangles is not equal to the null rectangle.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)