---
title: "drawHashMarksAndLabels(in:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsrulerview/drawhashmarksandlabels(in:)"
---

# drawHashMarksAndLabels(in:)

Draws the receiver’s hash marks and labels in aRect, which is expressed in the receiver’s coordinate system.

## Declaration

```swift
func drawHashMarksAndLabels(in rect: NSRect)
```

## Discussion

Discussion This method is invoked by draw(_:)—you should never need to invoke it directly. You can define custom measurement units using the class method registerUnit(withName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:). Override this method if you want to customize the appearance of the hash marks themselves.

## See Also

### Drawing

- [drawMarkers(in:)](appkit/nsrulerview/drawmarkers(in:).md)
- [invalidateHashMarks()](appkit/nsrulerview/invalidatehashmarks().md)
