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

# widgetList(_:shouldRemoveRow:)

Asks the delegate to allow or prohibit the specified row to be removed from the list.

## Declaration

```swift
optional func widgetList(_ list: NCWidgetListViewController, shouldRemoveRow row: Int) -> Bool
```

## Parameters

- `list`: The widget’s list view controller.
- `row`: The row that should be removed.

## Return Value

Return Value true if the specified row can be removed, otherwise false.

## Discussion

Discussion List item deletion is not enabled unless the delegate implements this method and widgetList(_:didRemoveRow:). Returning false prohibits row from being deleted. Returning YES allows row to be deleted, and the delegate will be called again when the item that row represents is deleted from the list view controller’s contents array.

## See Also

### Adding and Deleting Rows

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