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

# rulerView(_:shouldAdd:)

Requests permission for `aRulerView` to add `aMarker`, an NSRulerMarker being dragged onto the ruler by the user.

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

## Discussion

If the client returns <doc://com.apple.documentation/documentation/Swift/true> the ruler view accepts the new marker and begins tracking its movement; if the client returns <doc://com.apple.documentation/documentation/Swift/false> the ruler view refuses the new marker.

---

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)