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

# draw(_:)

Draws the receiver’s image that appears in the supplied rectangle.

```
func draw(_ rect: NSRect)
```

## Parameters

`rect`

The rectangle to be drawn, in the ruler view’s coordinate system.

## See Also

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

The rectangle occupied by the receiver’s image.



---

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)