<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTokenFieldCellDelegate/tokenFieldCell(_:hasMenuForRepresentedObject:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTokenFieldCellDelegate(im)tokenFieldCell:hasMenuForRepresentedObject:"
  },
  "title" : "tokenFieldCell(_:hasMenuForRepresentedObject:)"
}
-->

# tokenFieldCell(_:hasMenuForRepresentedObject:)

Allows the delegate to specify whether the represented object provides a menu.

```
@MainActor optional func tokenFieldCell(_ tokenFieldCell: NSTokenFieldCell, hasMenuForRepresentedObject representedObject: Any) -> Bool
```

## Parameters

`tokenFieldCell`

The token field cell that sent the message.

`representedObject`

A represented object of the token field.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the  represented object has a menu, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

By default tokens have no menus.

---

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)