Class

NCWidgetController

An object used to specify whether a Today widget has content to display.

Declaration

@interface NCWidgetController : NSObject

Overview

The NCWidgetController class defines an object that both a Today widget and the containing app that delivers the widget 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.

Typically, a widget appears in the Today view when it has content to display. If a currently running widget no longer has content to display, it can get a widget controller and set the flag in the setHasContent:forWidgetWithBundleIdentifier: method to false. If the containing app later determines that there is content this widget should display, the app can get a widget controller and update the flag, even while the widget isn’t running.

The NCWidgetController class should not be subclassed.

Topics

Getting a Widget Controller

+ widgetController

Returns a widget controller used to specify whether a widget has content to display.

Specifying the Presence of Content

- setHasContent:forWidgetWithBundleIdentifier:

Sets whether the specified widget has content to display.

Type Methods

Relationships

Inherits From

See Also

Core Widget

Building a Simple Widget for the Today View

Provide users with a glanceable look at your app’s data.

NCWidgetProviding

The interface for customizing the appearance and behavior of a Today widget.