<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/IntentDefinitions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting17IntentDefinitionsV"
  },
  "title" : "IntentDefinitions"
}
-->

# IntentDefinitions

A collection of definitions that catalog your app’s intents, enums, entities, and queries.

```
struct IntentDefinitions
```

## Overview

Use the `IntentDefinitions` structure as the entry point for creating type-erased
app intents for testing. Provide the bundle identifier of the app
under test, then use subscript syntax to retrieve definitions for
intents, entities, enums, or value queries as shown in the following example:

```swift
let definitions = IntentDefinitions(
    bundleIdentifier: "com.apple.example"
)

let intent = definitions.intents["OrderCoffeeIntent"]
    .makeIntent(size: "large")
let entity = definitions.entities["CoffeeEntity"]
    .makeReference(identifier: "latte-123")
let enumCase = definitions.enums["CoffeeSizeEnum"]
    .makeCase("large")
```

## Topics

### Creating an intent definition

[`init(bundleIdentifier: String)`](/documentation/AppIntentsTesting/IntentDefinitions/init(bundleIdentifier:))

Creates a new collection of definitions for intents that the specified app bundle contains.

[`let bundleIdentifier: String`](/documentation/AppIntentsTesting/IntentDefinitions/bundleIdentifier)

The bundle identifier of the app target under test.

### Accessing app intents

[`var intents: IntentDefinitions.DefinitionCollection<AppIntentDefinition>`](/documentation/AppIntentsTesting/IntentDefinitions/intents)

The definitions for the target app’s app intents.

[`struct AppIntentDefinition`](/documentation/AppIntentsTesting/AppIntentDefinition)

A definition you use to dynamically create intent instances for testing.

### Accessing app entities and queries

[`var entities: IntentDefinitions.DefinitionCollection<AppEntityDefinition>`](/documentation/AppIntentsTesting/IntentDefinitions/entities)

The definitions for the target app’s app entities.

[`struct AppEntityDefinition`](/documentation/AppIntentsTesting/AppEntityDefinition)

A definition you use to dynamically create entity instances for testing.

[`var valueQueries: IntentDefinitions.DefinitionCollection<IntentValueQueryDefinition>`](/documentation/AppIntentsTesting/IntentDefinitions/valueQueries)

The definitions for the app’s intent value queries.

[`struct IntentValueQueryDefinition`](/documentation/AppIntentsTesting/IntentValueQueryDefinition)

A definition you use to create an intent value query for testing.

[`var transientEntities: IntentDefinitions.DefinitionCollection<TransientAppEntityDefinition>`](/documentation/AppIntentsTesting/IntentDefinitions/transientEntities)

Retrieve a transient app entity definition using subscript syntax.

[`struct TransientAppEntityDefinition`](/documentation/AppIntentsTesting/TransientAppEntityDefinition)

A definition you use to dynamically create transient app entities for testing.

### Accessing app enums

[`var enums: IntentDefinitions.DefinitionCollection<AppEnumDefinition>`](/documentation/AppIntentsTesting/IntentDefinitions/enums)

The definitions for the target app’s app enums.

[`struct AppEnumDefinition`](/documentation/AppIntentsTesting/AppEnumDefinition)

An app enumeration definition for testing and dynamic enumeration creation.

### Supporting types

[`struct DefinitionCollection`](/documentation/AppIntentsTesting/IntentDefinitions/DefinitionCollection)

A collection of a specific type of definition.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)