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

# rulerView(_:shouldRemove:)

Requests permission for `aRulerView` to remove `aMarker`.

```
func rulerView(_ ruler: NSRulerView, shouldRemove marker: NSRulerMarker) -> Bool
```

## Discussion

If the client returns <doc://com.apple.documentation/documentation/Swift/true> the ruler view allows the user to remove the marker; if the client returns <doc://com.apple.documentation/documentation/Swift/false> the marker is kept pinned to the ruler’s baseline. This message is sent as many times as needed while the user drags the marker.

The user’s ability to remove a marker is typically set on the marker itself, using NSRulerMarker’s [`isRemovable`](/documentation/AppKit/NSRulerMarker/isRemovable) method. You should use this client view method only when the marker’s removability can vary while the user drags it (for example, if the user must press the Shift key to remove a marker).

---

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)