What is NSSuggestionItemResponse

Asked on 2024-07-30

1 search

NSSuggestionItemResponse is a new API introduced in macOS Sequoia that allows your app to provide custom suggestions as people type in a system-standard suggestions menu. This feature is part of the text entry suggestions in AppKit and works on any NSTextField, including subclasses like NSSearchField.

To get started, you need to set the suggestionsDelegate property on the text field. The delegate is asked for suggestions as text is typed and can respond with results both synchronously and asynchronously. It can also optionally customize the text completions on highlight and selection.

For more details, you can refer to the session What’s new in AppKit at the timestamp 17:06.