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

# NSRectToCGRect(_:)

Returns a `CGRect` typecast from an `NSRect`.

```
func NSRectToCGRect(_ nsrect: NSRect) -> CGRect
```

## Return Value

A `CGRect` typecast from an `NSRect`.

## See Also

[`NSPointToCGPoint(_:)`](/documentation/Foundation/NSPointToCGPoint(_:))

Returns a `CGPoint` typecast from an `NSPoint`.

[`NSSizeToCGSize(_:)`](/documentation/Foundation/NSSizeToCGSize(_:))

Returns a `CGSize` typecast from an `NSSize`.



---

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)