One Logo Pool Ball
WidgetKit · IOS API REFERENCE

AppIntentControlValueProvider

protocol · iOS 18.0+ · SDK 27.1

protocol AppIntentControlValueProvider

A type that uses a custom intent to provide a value to a control template. The provider quickly and cheaply prepares a synchronous value to be shown while previewing the control in the add sheet. When the actual control needs to be rendered, the actual, current value will be fetched asynchronously. The provider prepares these values using an intent containing user-editable parameters. For instance, a control that opens and closes various doors in a user's home may show a preview of the door being closed. When the actual control is rendered, the control may fetch the configured door's status from the cloud: struct DoorValueProvider: AppIntentControlValueProvider { func previewValue(configuration: SelectDoorIntent) -> Door { Door(id: configuration.doorId, isOpen: false) } func currentValue(configuration: SelectDoorIntent) async -> Door { let isOpen = await DoorManager.shared .status(doorId: configuration.doorId) return Door(id: configuration.doorId, isOpen: isOpen) } }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All WidgetKit types →