Framework

Notification​Center

Create and manage widgets.

Overview

The Notification Center framework helps you create and manage app extensions that implement widgets. The framework provides an API you can use to specify whether a widget has content to display, and to customize aspects of its appearance and behavior. To learn more about creating a widget app extension, see App Extension Programming Guide.

In macOS, the Notification Center framework provides ways to customize the editing and searching experience in a widget.

Symbols

Classes

NCWidget​Controller

The NCWidget​Controller class defines an object that both a widget (that is, a Today extension) and the app that delivers the widget (called the containing app) can use to specify whether the widget has content to display. Because this class helps a widget and its containing app coordinate the display of the widget’s content, a widget that doesn’t communicate with its containing app is unlikely to use this class.

NCWidget​List​View​Controller

The NCWidget​List​View​Controller class provides a list view for displaying content in a Today widget (a widget is an extension in the Today view of Notification Center). A list view controller works together with its delegate to display content and support user interaction with the list. To learn about the list view controller delegate methods, see NCWidget​List​View​Delegate.

NCWidget​Search​View​Controller

The NCWidget​Search​View​Controller class provides a default search view within a widget (a widget is an extension in the Today view of Notification Center). A search view controller works together with its delegate to perform searches on the user’s input and display results from which a user can choose. To learn about the search view controller delegate methods, see NCWidget​Search​View​Delegate.

Protocols

NCWidget​List​View​Delegate

The NCWidget​List​View​Delegate protocol defines methods that handle content display and editing in the list view of a Today widget (a widget is an extension in the Today view of Notification Center). The delegate of an NCWidget​List​View​Controller must adopt the NCWidget​List​View​Delegate protocol.

NCWidget​Providing

The NCWidget​Providing protocol lets you customize some of the appearance and behavior of a widget (a widget is an app extension).

NCWidget​Search​View​Delegate

The NCWidget​Search​View​Delegate protocol defines methods that enable user searches in the search view controller of a widget (a widget is an extension in the Today view of Notification Center). The delegate of an NCWidget​Search​View​Controller must adopt the NCWidget​Search​View​Delegate protocol.

Reference

Notification Center Constants

This document describes the constants in the Notification Center framework.

Notification​Center Enumerations

Extended Types

NSExtension​Context

Represents the host app context from which an app extension is invoked.

NSView​Controller

A view controller manages a view, typically loaded from a nib file.

UIVibrancy​Effect

A UIVibrancy​Effect object amplifies and adjusts the color of the content layered behind a UIVisual​Effect​View object, allowing the content placed inside of the content​View to become more vivid.