---
title: "widgetSearch(_:resultSelected:)"
framework: Notification Center
role: symbol
role_heading: Instance Method
platforms: [macOS 10.10+]
path: "notificationcenter/ncwidgetsearchviewdelegate/widgetsearch(_:resultselected:)"
---

# widgetSearch(_:resultSelected:)

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

## Declaration

```swift
func widgetSearch(_ controller: NCWidgetSearchViewController, resultSelected object: Any)
```

## Parameters

- `controller`: The widget’s search view controller.
- `object`: The object in the search view controller’s doc://com.apple.notificationcenter/documentation/NotificationCenter/NCWidgetSearchViewController/searchResults array that represents the search result chosen by the user.

## Discussion

Discussion When this method returns, the search view controller is dismissed.

## See Also

### Responding to User Choices

- [widgetSearchTermCleared(_:)](notificationcenter/ncwidgetsearchviewdelegate/widgetsearchtermcleared(_:).md)
