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


protocol NCWidgetProviding


The NCWidgetProviding protocol allows customization of the appearance and behavior of a Today widget.


Customizing the Display

func widgetMarginInsets(forProposedMarginInsets: UIEdgeInsets) -> UIEdgeInsets

Called to let a widget accept the default margin inset values or return custom values to use instead.

enum NCWidgetDisplayMode

The modes that can be toggled between when the user activates the More button for a widget running in iOS.

Updating a Widget’s Contents

func widgetPerformUpdate(completionHandler: (NCUpdateResult) -> Void)

Called to give a widget an opportunity to update its contents.

enum NCUpdateResult

The result of updating a widget's state.

Supporting Editing

var widgetAllowsEditing: Bool

A Boolean value indicating whether the widget can be edited by users.

func widgetDidBeginEditing()

Called when a user chooses the widget’s begin editing button.

func widgetDidEndEditing()

Called when a widget’s editing session ends.


See Also

Core Widget

Building a Simple Widget for the Today View

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

class NCWidgetController

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