One Logo Pool Ball
AppIntents · IOS API REFERENCE

IntentPrediction

struct · iOS 16.0+ · SDK 27.1

struct IntentPrediction<Intent, T> where Intent : AppIntent

A prediction for an app intent that the system might display to someone when it’s relevant. Use the `IntentPrediction` type to provide a description of your app intent that the system can use when offering proactive suggestions. You create this type from the ``PredictableIntent/predictionConfiguration`` property of your app intent. Use the type to provide a ``DisplayRepresentation`` structure with a suitable description of your app intent’s purpose. The following example shows an implementation of the ``PredictableIntent/predictionConfiguration`` property that creates an `IntentPrediction` type. During creation of the type, the code passes the app intent’s `name` property to the `IntentPrediction` initializer, and maps it to the `name` parameter in the closure. The description incorporates this value in the text it provides. ``` struct CreateBook: AppIntent, PredictableIntent { @Parameter(title: "Book Name") var name: String? @Parameter(title: "Author", query: AuthorQuery.self) var author: AuthorEntity? static var predictionConfiguration: some IntentPredictionConfiguration { IntentPrediction(parameters: (\Self.$name)) { name in DisplayRepresentation( title: "Create a book named \(name)" ) } } @MainActor func perform() async throws -> IntentResult<BookEntity> { ... } } ```

Members (0)

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

Skipped declarations

16 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for Intent)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(parameters:displayRepresentation:)

This declaration needs Swift generic type arguments. (no canonical witness for K0)

IntentPrediction.init(displayRepresentation:)

callback cannot propagate synchronous failure

All AppIntents types →