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

# NSEraseRect(_:)

Erases the specified rect by filling it with white.

```
func NSEraseRect(_ rect: NSRect)
```

## Parameters

`rect`

The rectangle (in the current coordinate system) defining the area to erase.

## Discussion

This function fills the specified rectangle with white. It does not alter the current color.

---

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)