---
title: updateRuler()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nstextview/updateruler()
---

# updateRuler()

Updates the ruler view in the receiver’s enclosing scroll view to reflect the selection’s paragraph and marker attributes.

## Declaration

```swift
func updateRuler()
```

## Discussion

Discussion Does nothing if the ruler isn’t visible or if the receiver doesn’t use the ruler. You should never need to invoke this method directly, but you can override this method if needed to handle additional ruler attributes.

## See Also

### Related Documentation

- [usesRuler](appkit/nstextview/usesruler.md)

### Customizing subclass behaviors

- [updateFontPanel()](appkit/nstextview/updatefontpanel().md)
- [acceptableDragTypes](appkit/nstextview/acceptabledragtypes.md)
- [updateDragTypeRegistration()](appkit/nstextview/updatedragtyperegistration().md)
- [selectionRange(forProposedRange:granularity:)](appkit/nstextview/selectionrange(forproposedrange:granularity:).md)
- [rangeForUserCharacterAttributeChange](appkit/nstextview/rangeforusercharacterattributechange.md)
- [rangesForUserCharacterAttributeChange](appkit/nstextview/rangesforusercharacterattributechange.md)
- [rangeForUserParagraphAttributeChange](appkit/nstextview/rangeforuserparagraphattributechange.md)
- [rangesForUserParagraphAttributeChange](appkit/nstextview/rangesforuserparagraphattributechange.md)
- [rangeForUserTextChange](appkit/nstextview/rangeforusertextchange.md)
- [rangesForUserTextChange](appkit/nstextview/rangesforusertextchange.md)
- [shouldChangeText(in:replacementString:)](appkit/nstextview/shouldchangetext(in:replacementstring:).md)
- [shouldChangeText(inRanges:replacementStrings:)](appkit/nstextview/shouldchangetext(inranges:replacementstrings:).md)
- [didChangeText()](appkit/nstextview/didchangetext().md)
- [smartInsertDeleteEnabled](appkit/nstextview/smartinsertdeleteenabled.md)
- [smartDeleteRange(forProposedRange:)](appkit/nstextview/smartdeleterange(forproposedrange:).md)
