---
title: "tokenField(_:hasMenuForRepresentedObject:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstokenfielddelegate/tokenfield(_:hasmenuforrepresentedobject:)"
---

# tokenField(_:hasMenuForRepresentedObject:)

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

## Declaration

```swift
@MainActor optional func tokenField(_ tokenField: NSTokenField, hasMenuForRepresentedObject representedObject: Any) -> Bool
```

## Parameters

- `tokenField`: The token field that sent the message.
- `representedObject`: A represented object of the token field.

## Return Value

Return Value true if the  represented object has a menu, false otherwise.

## Discussion

Discussion By default tokens in a token field have no menus.

## See Also

### Managing Menus for Represented Objects

- [tokenField(_:menuForRepresentedObject:)](appkit/nstokenfielddelegate/tokenfield(_:menuforrepresentedobject:).md)
