<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/removeCursorRect(_:cursor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)removeCursorRect:cursor:"
  },
  "title" : "removeCursorRect(_:cursor:)"
}
-->

# removeCursorRect(_:cursor:)

Completely removes a cursor rectangle from the view.

```
func removeCursorRect(_ rect: NSRect, cursor object: NSCursor)
```

## Parameters

`rect`

A rectangle defining a region of the view. Must match a value previously specified using [`addCursorRect(_:cursor:)`](/documentation/AppKit/NSView/addCursorRect(_:cursor:)).

`object`

An object representing a cursor. Must match a value previously specified using [`addCursorRect(_:cursor:)`](/documentation/AppKit/NSView/addCursorRect(_:cursor:)).

## Discussion

You should rarely need to use this method. The [`resetCursorRects()`](/documentation/AppKit/NSView/resetCursorRects()) method, which is called when the cursor rectangles need to be rebuilt, should establish only the cursor rectangles needed. If you implement [`resetCursorRects()`](/documentation/AppKit/NSView/resetCursorRects()) in this way, you can then simply modify the state that [`resetCursorRects()`](/documentation/AppKit/NSView/resetCursorRects()) uses to build its cursor rectangles and then invoke the `NSWindow` method [`invalidateCursorRects(for:)`](/documentation/AppKit/NSWindow/invalidateCursorRects(for:)).

---

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)