---
title: "rulerView(_:shouldRemove:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/rulerview(_:shouldremove:)"
---

# rulerView(_:shouldRemove:)

Requests permission for aRulerView to remove aMarker.

## Declaration

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

## Discussion

Discussion If the client returns true the ruler view allows the user to remove the marker; if the client returns 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 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).

## See Also

### Synchronizing with Ruler Views

- [rulerView(_:didAdd:)](appkit/nsview/rulerview(_:didadd:).md)
- [rulerView(_:didMove:)](appkit/nsview/rulerview(_:didmove:).md)
- [rulerView(_:didRemove:)](appkit/nsview/rulerview(_:didremove:).md)
- [rulerView(_:handleMouseDownWith:)](appkit/nsview/rulerview(_:handlemousedownwith:).md)
- [rulerView(_:locationFor:)](appkit/nsview/rulerview(_:locationfor:).md)
- [rulerView(_:pointForLocation:)](appkit/nsview/rulerview(_:pointforlocation:).md)
- [rulerView(_:shouldAdd:)](appkit/nsview/rulerview(_:shouldadd:).md)
- [rulerView(_:shouldMove:)](appkit/nsview/rulerview(_:shouldmove:).md)
- [rulerView(_:willAdd:atLocation:)](appkit/nsview/rulerview(_:willadd:atlocation:).md)
- [rulerView(_:willMove:toLocation:)](appkit/nsview/rulerview(_:willmove:tolocation:).md)
- [rulerView(_:willSetClientView:)](appkit/nsview/rulerview(_:willsetclientview:).md)
