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

# rulerView(_:didAdd:)

Informs the client that `aRulerView` allowed the user to add `aMarker`.

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

## Discussion

The client can take whatever action it needs based on this message, such as adding a new tab stop to the selected paragraph or creating a layout guideline.

## See Also

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

The object the receiver represents.

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

The location of the receiver in the coordinate system of the ruler view’s client view.



---

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)