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

# rulerView(_:shouldRemove:)

Returns whether the marker should be removed.

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

## Parameters

`ruler`

The ruler view sending the message.

`marker`

The marker to be removed.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `aMarker` can be removed, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

Only markers that represent tab stops can be removed. This method returns <doc://com.apple.documentation/documentation/Swift/true> if `aMarker` represents an [`NSTextTab`](/documentation/AppKit/NSTextTab) object, <doc://com.apple.documentation/documentation/Swift/false> otherwise. Because this method can be invoked repeatedly as the user drags a ruler marker, it returns that value immediately. If the change is allowed and the user actually removes the marker, the receiver is also sent a [`rulerView(_:didRemove:)`](/documentation/AppKit/NSTextView/rulerView(_:didRemove:)) message.

---

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)