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

# tokenField(_:editingStringForRepresentedObject:)

Allows the delegate to provide a string to be edited as a proxy for a represented object.

```
@MainActor optional func tokenField(_ tokenField: NSTokenField, editingStringForRepresentedObject representedObject: Any) -> String?
```

## Parameters

`tokenField`

The token field that sent the message.

`representedObject`

A represented object of the token field.

## Return Value

A string that’s an editable proxy of the represented object, or `nil` if the token should not be editable.

---

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)