Instance Method

setHasContent(_:forWidgetWithBundleIdentifier:)

Sets whether the specified widget has content to display.

Declaration

func setHasContent(_ flag: Bool, forWidgetWithBundleIdentifier bundleID: String)

Parameters

flag

Indicates whether the widget has content to display. Default value is true.

bundleID

The bundle identifier of the widget.

Discussion

Both a widget and its containing app can use this method to specify whether the widget has content to display. The value of flag determines whether a widget should be visible in the Today view and whether the widget’s most recent snapshot is still valid.