<!--
{
  "availability" : [
    "macOS: 10.12.2 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCandidateListTouchBarItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCandidateListTouchBarItem"
  },
  "title" : "NSCandidateListTouchBarItem"
}
-->

# NSCandidateListTouchBarItem

A bar item that, along with its delegate, provides a list of textual suggestions for the current text view.

```
class NSCandidateListTouchBarItem<CandidateType> where CandidateType : AnyObject
```

## Topics

### Providing a client and a delegate

[`client`](/documentation/AppKit/NSCandidateListTouchBarItem/client)

The client object for the candidate list item.

[`delegate`](/documentation/AppKit/NSCandidateListTouchBarItem/delegate)

The delegate of the candidate list item.

[`NSCandidateListTouchBarItemDelegate`](/documentation/AppKit/NSCandidateListTouchBarItemDelegate)

A set of methods that a candidate list item delegate uses to enable selection state and list visibility.

### Populating the candidate list

[`setCandidates(_:forSelectedRange:in:)`](/documentation/AppKit/NSCandidateListTouchBarItem/setCandidates(_:forSelectedRange:in:))

Sets an array of candidate objects to be displayed in the candidate list bar item.

[`candidates`](/documentation/AppKit/NSCandidateListTouchBarItem/candidates)

The array of candidate objects previously set by [`setCandidates(_:forSelectedRange:in:)`](/documentation/AppKit/NSCandidateListTouchBarItem/setCandidates(_:forSelectedRange:in:)).

[`attributedStringForCandidate`](/documentation/AppKit/NSCandidateListTouchBarItem/attributedStringForCandidate)

A block that converts a candidate object into an attributed string for display in the candidate list item.

[`allowsTextInputContextCandidates`](/documentation/AppKit/NSCandidateListTouchBarItem/allowsTextInputContextCandidates)

A Boolean value that specifies whether a candidate list item displays candidates from text input providers.

### Handling collapsible behavior

[`allowsCollapsing`](/documentation/AppKit/NSCandidateListTouchBarItem/allowsCollapsing)

A Boolean value that specifies whether the item can be collapsed.

[`isCollapsed`](/documentation/AppKit/NSCandidateListTouchBarItem/isCollapsed)

A Boolean value that controls the visibility of the candidate list.

### Managing candidate list visibility

[`isCandidateListVisible`](/documentation/AppKit/NSCandidateListTouchBarItem/isCandidateListVisible)

A Boolean value that represents the visibility of this item’s candidate list.

[`update(withInsertionPointVisibility:)`](/documentation/AppKit/NSCandidateListTouchBarItem/update(withInsertionPointVisibility:))

Updates the candidate list visibility configuration based on the client’s insertion point state.

### Configuring bar customization

[`customizationLabel`](/documentation/AppKit/NSCandidateListTouchBarItem/customizationLabel)

The user-visible string identifying this item during bar customization.



---

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)