<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSIntersectsRect(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@F@NSIntersectsRect"
  },
  "title" : "NSIntersectsRect(_:_:)"
}
-->

# NSIntersectsRect(_:_:)

Returns a Boolean value that indicates whether two rectangles intersect.

```
func NSIntersectsRect(_ aRect: NSRect, _ bRect: NSRect) -> Bool
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `aRect` intersects `bRect`, otherwise <doc://com.apple.documentation/documentation/Swift/false>. Returns <doc://com.apple.documentation/documentation/Swift/false> if either `aRect` or `bRect` has a width or height that is 0.

---

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)