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

# tokenFieldCell(_:writeRepresentedObjects:to:)

Allows the delegate the opportunity to write custom pasteboard types to the pasteboard for the represented objects in `objects`.

```
@MainActor optional func tokenFieldCell(_ tokenFieldCell: NSTokenFieldCell, writeRepresentedObjects objects: [Any], to pboard: NSPasteboard) -> Bool
```

## Parameters

`tokenFieldCell`

The token field cell that sent the message.

`objects`

An array of represented objects associated with the token field cell.

`pboard`

The pasteboard to which to write the represented objects.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the delegate writes the represented objects to the pasteboard, <doc://com.apple.documentation/documentation/Swift/false> otherwise. If <doc://com.apple.documentation/documentation/Swift/false>, the token field writes the display strings to the [`NSStringPboardType`](/documentation/AppKit/NSStringPboardType) pasteboard.

---

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)