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

# tokenField(_:editingStringForRepresentedObject:)

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

## Declaration

```swift
@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

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

## See Also

### Editing a Tokenized Strings

- [tokenField(_:completionsForSubstring:indexOfToken:indexOfSelectedItem:)](appkit/nstokenfielddelegate/tokenfield(_:completionsforsubstring:indexoftoken:indexofselecteditem:).md)
- [tokenField(_:representedObjectForEditing:)](appkit/nstokenfielddelegate/tokenfield(_:representedobjectforediting:).md)
- [tokenField(_:shouldAdd:at:)](appkit/nstokenfielddelegate/tokenfield(_:shouldadd:at:).md)
