<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/AppIntentControlValueProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit29AppIntentControlValueProviderP"
  },
  "title" : "AppIntentControlValueProvider"
}
-->

# AppIntentControlValueProvider

A type that uses a custom intent to provide a value to a control template.

```
protocol AppIntentControlValueProvider
```

## Overview

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)
    }
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)