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

# rulerView(_:didMove:)

Modifies the paragraph style of the paragraphs containing the selection to record the new location of the marker.

```
func rulerView(_ ruler: NSRulerView, didMove marker: NSRulerMarker)
```

## Parameters

`ruler`

The ruler view sending the message.

`marker`

The marker that was moved.

## Discussion

This method records the change by invoking [`didChangeText()`](/documentation/AppKit/NSTextView/didChangeText()) after moving the marker.

`NSTextView` checks for permission to make the change in its [`rulerView(_:shouldMove:)`](/documentation/AppKit/NSTextView/rulerView(_:shouldMove:)) method, which invokes [`shouldChangeText(in:replacementString:)`](/documentation/AppKit/NSTextView/shouldChangeText(in:replacementString:)) to send out the proper request and notifications, and only invokes this method if permission is granted.

## See Also

[`representedObject`](/documentation/AppKit/NSRulerMarker/representedObject)

The object the receiver represents.



---

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)