---
title: "toggleRuler(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstext/toggleruler(_:)"
---

# toggleRuler(_:)

This action method shows or hides the ruler, if the receiver is enclosed in a scroll view.

## Declaration

```swift
func toggleRuler(_ sender: Any?)
```

## See Also

### Using the ruler

- [isRulerVisible](appkit/nstext/isrulervisible.md)
