<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/showDefinition(for:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)showDefinitionForAttributedString:atPoint:"
  },
  "title" : "showDefinition(for:at:)"
}
-->

# showDefinition(for:at:)

Shows a window displaying the definition of the attributed string at the specified point.

```
func showDefinition(for attrString: NSAttributedString?, at textBaselineOrigin: NSPoint)
```

## Parameters

`attrString`

The attributed string for which to show the definition. If the view is an instance of NSTextView, the `attrString` can be `nil`, in which case the text view will automatically supply values suitable for displaying definitions for the specified range within its text content.

`textBaselineOrigin`

Specifies the baseline origin of `attrString` in the view’s coordinate system.

## Discussion

Shows a window that displays the definition (or other subject depending on available dictionaries) of the specified attributed string.

This method can be used for implementing the same functionality as the `NSTextView` “Look Up in Dictionary” contextual menu on a custom view.

---

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)