Protocol

NCWidgetSearchViewDelegate

The interface for enabling user searches in the search view controller of a macOS Today widget.

Declaration

@protocol NCWidgetSearchViewDelegate

Overview

The NCWidgetSearchViewDelegate protocol defines methods that enable user searches in the search view controller of a Today widget. The delegate of an NCWidgetSearchViewController must adopt the NCWidgetSearchViewDelegate protocol.

The search view controller tells its delegate to perform a search on a user’s input and the delegate returns the results by setting the controller’s searchResults property. The search view controller also tells its delegate when a user clears the search field or chooses a search result, so that the delegate can prepare for a new search or dismissal.

Topics

Searching Your Content

- widgetSearch:searchForTerm:maxResults:

Asks the delegate to search using the specified term.

Required.

Responding to User Choices

- widgetSearch:resultSelected:

Tells the delegate that a user chose the specified search result.

Required.

- widgetSearchTermCleared:

Tells the delegate that a user cleared the search field.

Required.

Relationships

Inherits From

See Also

Search View

NCWidgetSearchViewController

An object that provides a default search view within a macOS Today widget.