<!--
{
  "availability" : [
    "macOS: 10.10.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NotificationCenter",
  "identifier" : "/documentation/NotificationCenter/NCWidgetSearchViewDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Notification Center"
    ],
    "preciseIdentifier" : "c:objc(pl)NCWidgetSearchViewDelegate"
  },
  "title" : "NCWidgetSearchViewDelegate"
}
-->

# NCWidgetSearchViewDelegate

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

```
protocol NCWidgetSearchViewDelegate : NSObjectProtocol
```

## Overview

The `NCWidgetSearchViewDelegate` protocol defines methods that enable user searches in the search view controller of a Today widget. The [`delegate`](/documentation/NotificationCenter/NCWidgetSearchViewController/delegate) of an [`NCWidgetSearchViewController`](/documentation/NotificationCenter/NCWidgetSearchViewController) must adopt the [`NCWidgetSearchViewDelegate`](/documentation/NotificationCenter/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`](/documentation/NotificationCenter/NCWidgetSearchViewController/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:)`](/documentation/NotificationCenter/NCWidgetSearchViewDelegate/widgetSearch(_:searchForTerm:maxResults:))

Asks the delegate to search using the specified term.

### Responding to User Choices

[`widgetSearch(_:resultSelected:)`](/documentation/NotificationCenter/NCWidgetSearchViewDelegate/widgetSearch(_:resultSelected:))

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

[`widgetSearchTermCleared(_:)`](/documentation/NotificationCenter/NCWidgetSearchViewDelegate/widgetSearchTermCleared(_:))

Tells the delegate that a user cleared the search field.



---

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)