---
title: "highlight(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/highlight(_:)"
---

# highlight(_:)

An action for toggling NSTextHighlightStyleAttributeName in the receiver’s selected range. The sender should be a menu item with a representedObject of type (NSTextHighlightColorScheme).

## Declaration

```swift
@IBAction func highlight(_ sender: Any?)
```
