Protocol

NCWidgetListViewDelegate

The interface for handling content display and editing in the list view of a macOS Today widget.

Declaration

@protocol NCWidgetListViewDelegate

Overview

The NCWidgetListViewDelegate protocol defines methods that handle content display and editing in the list view of a Today widget. The delegate of an NCWidgetListViewController must adopt the NCWidgetListViewDelegate protocol.

The single required method in the protocol, widgetList:viewControllerForRow:, creates a view controller for the contents of one row in the widget’s list view. Optional methods in the NCWidgetListViewDelegate protocol support editing actions, such as adding a new list item and reordering or deleting list rows.

Topics

Creating a Content View Controller

- widgetList:viewControllerForRow:

Asks the delegate for a content view controller for the specified row.

Required.

Adding and Deleting Rows

- widgetList:didRemoveRow:

Tells the delegate that the specified row was removed from the list.

- widgetList:shouldRemoveRow:

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

- widgetListPerformAddAction:

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

Reordering List Rows

- widgetList:didReorderRow:toRow:

Tells the delegate that the specified row was moved to a new location.

- widgetList:shouldReorderRow:

Asks the delegate to allow or prohibit the specified row to be moved to a new location in the list.

Relationships

Inherits From

See Also

Displaying and Editing List Content

delegate

The list view controller’s delegate or nil if the receiver doesn’t have a delegate.