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

# rulerView(_:shouldMove:)

Returns whether the marker should be moved.

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

## Parameters

`ruler`

The ruler view sending the message.

`marker`

The marker to be moved.

## Return Value

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

## Discussion

This method controls whether an existing marker `aMarker` can be moved. The receiver checks for permission to make the change by invoking [`shouldChangeText(in:replacementString:)`](/documentation/AppKit/NSTextView/shouldChangeText(in:replacementString:)) and returning the return value of that message. If the change is allowed, the receiver is then sent a [`rulerView(_:didMove:)`](/documentation/AppKit/NSTextView/rulerView(_:didMove:)) 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)