---
title: "widgetListPerformAddAction(_:)"
framework: Notification Center
role: symbol
role_heading: Instance Method
platforms: [macOS 10.10+]
path: "notificationcenter/ncwidgetlistviewdelegate/widgetlistperformaddaction(_:)"
---

# widgetListPerformAddAction(_:)

Asks the delegate to perform an action when the Add (+) button is clicked.

## Declaration

```swift
optional func widgetListPerformAddAction(_ list: NCWidgetListViewController)
```

## Parameters

- `list`: The widget’s list view controller.

## Discussion

Discussion When a widget’s list is in editing mode, the list view controller can display an Add (+) button. The button’s action calls widgetListPerformAddAction: in the delegate. If you want to display the default search view in the add action, you can use the presentViewControllerInWidget: method of NSViewController  to present an NCWidgetSearchViewController instance in the widget’s principal view controller.

## See Also

### Adding and Deleting Rows

- [widgetList(_:didRemoveRow:)](notificationcenter/ncwidgetlistviewdelegate/widgetlist(_:didremoverow:).md)
- [widgetList(_:shouldRemoveRow:)](notificationcenter/ncwidgetlistviewdelegate/widgetlist(_:shouldremoverow:).md)
