Contents

widgetActiveDisplayModeDidChange(_:withMaximumSize:)

Called when the active display mode changes.

Declaration

optional func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize)

Parameters

  • activeDisplayMode:

    The new active display mode. See Ncwidgetdisplaymode for possible values.

  • maxSize:

    A Cgsize object that represents the new maximum size this widget can have.

Discussion

You might implement this method if your widget should change its preferredContentSize value to better accommodate the new display mode.

Widgets displayed as NCWidgetDisplayMode.compact have a fixed size passed in the maxSize parameter.

See Also

Customizing the Display