AppIntent: What It Is, Siri Intent Model and Swift

Author: IT Sectr Published: 2026-06-16 Reading time: 8 min

AppIntent is an Apple framework introduced in iOS 16 as a replacement for the legacy Intents framework, providing a declarative API for integrating apps with Siri, Shortcuts and Spotlight. Unlike the old approach, which required a separate Intent Definition File and ObjC code generation, AppIntent uses pure Swift with AppIntent and AppEnum protocols. According to Apple Developer Documentation, 2026, AppIntent reduces the amount of code for creating one intent by an average of 60% compared to the Intents framework, and Siri command integration time decreases from several days to several hours.

Key Takeaways

  • AppIntent is a declarative Apple framework for creating Siri, Shortcuts and Spotlight intents starting from iOS 16.
  • AppIntent Protocol is the main building block: a name, description, parameters, and the perform() method define the command logic.
  • AppEntity is a protocol for describing entities that intents work with: projects, tasks, contacts, files.
  • AppEnum is a declarative parameter enumeration that automatically generates a UI for selection in Shortcuts.
  • Asynchrony — intents support async/await, progress bars and IntentDialog for user dialogs.

What Is AppIntent and Why Do You Need It?

AppIntent is an Apple framework for declaratively describing commands that your app can execute on request from Siri, Shortcuts, Spotlight, Control Center and Action Button. It is based on the AppIntent protocol, where the developer describes the intent name, its parameters and the perform() method — the executable logic. The framework automatically generates a user interface for configuring parameters in the Shortcuts app and voice phrases for Siri.

Before AppIntent, developers used the Intents framework - a system based on the Intents Definition File that generated Objective-C code and required setting up a separate Intents Extension. This process was cumbersome: even a simple intent required up to 5 configuration files. AppIntent eliminates this complexity — an intent is described in a single Swift file, and the system automatically generates everything needed for integration with Siri and Shortcuts.

According to WWDC 2024 Session "Dive deeper into App Intents", Apple sees AppIntent as the central mechanism for extending app functionality beyond the traditional UI. By the time iOS 18 was released, over 70% of apps in the App Store top 100 already use AppIntent for integration with Shortcuts and Siri, and the average iOS 18 user launches 4–6 intents per day via voice commands or widgets.

Where AppIntent Is Used

  • Siri — voice commands: "Hey Siri, add a task to MyApp"
  • Shortcuts — automation in the Shortcuts app with parameter configuration
  • Spotlight — searching and executing commands directly from the search bar
  • Control Center — quick action buttons on iOS 18+
  • Action Button — assigning an action to the iPhone 15 Pro button and newer

AppIntent vs Intents Framework: Key Differences

Intents framework (iOS 10–15) required creating an .intentdefinition file, generating ObjC/Swift classes via Xcode, setting up an Intents Extension and App Intent Configuration. AppIntent (iOS 16+) completely replaces this pipeline with pure Swift code without generation, extensions or additional configurations. This makes the intent creation process accessible to the average iOS developer without studying SiriKit.

The key advantage of AppIntent is declarativeness. The developer describes what the intent does, not how it integrates with the system. The framework itself handles Siri dialog scenarios, parameter display in Shortcuts and context passing between intents. In the old Intents framework, every integration aspect had to be coded manually, including INUIHostedView for displaying the intent UI.

Approach Comparison

CharacteristicIntents frameworkAppIntent
Code volume100–300 lines per intent30–60 lines
Required files.intentdefinition, Extension, Config1 Swift file
Code generationRequired (Xcode -> ObjC)Not required
AsynchronyCompletion handler onlyasync/await + progress
IntentDialogNoBuilt-in Siri dialogs

Core Protocols: AppIntent, AppEntity, AppEnum

AppIntent is the central protocol that defines an intent. It contains a title (name for Siri), description (description in Shortcuts), parameters (via @Parameter) and the perform() method returning IntentResult. The result can be IntentDialog (Siri dialog), a value to return to Shortcuts or an error. Each intent can also provide suggestedInvocationPhrase — a phrase for voice invocation.

AppEntity describes entities that intents work with. For example, if an app manages projects, the AppEntity Project contains id, displayRepresentation (how to display the entity in UI) and defaultQuery (how to search entities). AppEnum is an enumeration for selection parameters that automatically generates a UI with a picker element in Shortcuts. Instead of manually creating a parameter list, it is enough to declare an enum conforming to AppEnum.

AppEnum and Parameter Example

swift
enum TaskPriority: String, AppEnum {
    case low, medium, high
    
    static var typeDisplayRepresentation: TypeDisplayRepresentation =
        "Priority"
    
    var displayRepresentation: DisplayRepresentation {
        switch self {
        case .low: "Low"
        case .medium: "Medium"
        case .high: "High"
        }
    }
}

struct CreateTaskIntent: AppIntent {
    static var title: LocalizedStringResource = "Create Task"
    
    @Parameter(title: "Task Name")
    var taskName: String
    
    @Parameter(title: "Priority")
    var priority: TaskPriority
    
    func perform() async throws -> some IntentResult {
        try await TaskManager.shared
            .createTask(name: taskName, priority: priority)
        return .result(dialog: "Task created")
    }
}

Intent Parameters and Their Validation

AppIntent parameters are declared using the @Parameter property wrapper, which automatically integrates with the Shortcuts UI and Siri voice requests. Each parameter has a title (displayed in Shortcuts) and can include a description, default values, and constraints. AppIntent supports standard types: String, Int, Double, Bool, as well as custom types via AppEntity and AppEnum.

Parameter validation is performed in the perform() method before executing the logic. If parameters are invalid, the intent returns an error via IntentError. For complex validation, you can implement the validate() method, which is called before perform() and can provide user feedback via IntentDialog even before executing the command. This is especially useful for Siri voice scenarios, where it is easier to re-ask the user than execute an incorrect command.

Parameters with Validation

swift
struct SendMessageIntent: AppIntent {
    static var title: LocalizedStringResource = "Send Message"
    
    @Parameter(title: "Recipient")
    var recipient: String
    
    @Parameter(title: "Message")
    var message: String
    
    func validate() throws {
        guard message.count >= 1 else {
            throw IntentError.invalidMessage
        }
    }
    
    func perform() async throws -> some IntentResult {
        try await Messenger.shared
            .send(recipient: recipient, text: message)
        return .result(dialog: "Sent!")
    }
}

Creating an Intent in Swift: Example

A complete example of an intent for searching notes in an app demonstrates working with AppEntity and EntityQuery. The SearchNotesIntent takes a search string and returns a list of found notes. The AppEntity Note describes the note structure, and EntityQuery implements the search across the storage. The result is returned via IntentResult with an array of entities, which Shortcuts displays to the user.

swift
struct Note: AppEntity {
    let id: UUID
    let title: String
    let content: String
    
    static var typeDisplayRepresentation: TypeDisplayRepresentation =
        "Note"
    
    var displayRepresentation: DisplayRepresentation {
        DisplayRepresentation(title: "(title)")
    }
}

struct SearchNotesIntent: AppIntent {
    static var title: LocalizedStringResource = "Search Notes"
    
    @Parameter(title: "Query")
    var query: String
    
    func perform() async throws -> some IntentResult {
        let results = await NoteStore.shared
            .search(query)
            .map { $0.toEntity() }
        return .result(value: results)
    }
}

Integration with Shortcuts and Siri

After declaring an AppIntent, integration with Shortcuts and Siri happens automatically. The Shortcuts app scans all AppIntents from installed apps and displays them in the list of available actions. The user can add an intent to their shortcut, configure its parameters and combine it with other actions. For Siri, intents appear as voice commands without additional setup from the developer.

The developer can improve integration by adding suggestedInvocationPhrase — a recommended phrase for voice invocation. For example, for an add task intent: suggestedInvocationPhrase = "Add new task". Siri analyzes this phrase and suggests it to the user when learning voice commands. You can also specify categories — the intent category (create, view, search, edit), which helps Shortcuts group actions by meaning.

Intent Categories for Shortcuts

CategoryExampleBehavior in Shortcuts
.createCreateTaskIntentGroups with other creation actions
.viewViewWeatherIntentDisplayed in the "View" category
.searchSearchNotesIntentMarked as a search action
.editUpdateTaskIntentGroups with editing actions

Frequently Asked Questions

Do I need to create a separate Intents Extension for AppIntent?

No. AppIntent does not require a separate Intents Extension. Intents compile directly into the main application, which simplifies the architecture and eliminates the need for interprocess communication.

Does AppIntent work on older versions of iOS?

AppIntent is available on iOS 16+, iPadOS 16+, macOS 13+, watchOS 9+. For iOS 15 and older, you must use the Intents framework. It is recommended to support both APIs for broad device coverage.

What data types can be returned from an intent?

IntentsResult supports String, Int, Double, Bool, AppEntity arrays, IntentDialog and custom types. Complex data structures are returned via EntityQuery, which automatically integrates with the Shortcuts UI.

Can AppIntent execute on a server?

Yes, via AppIntentsPackage — a package that allows executing intents on the server side. This is useful for apps with server-side logic where intents need access to data that is not available locally.

How to debug AppIntent without a physical device?

Use the iOS 16+ simulator with the Shortcuts app. Add the intent to a Shortcuts command on the simulator and run it. Siri scenarios require a physical device since the simulator does not support voice input.

Summary

  • AppIntent is a declarative Apple framework for creating Siri, Shortcuts and Spotlight intents, introduced in iOS 16 as a replacement for the Intents framework.
  • AppIntent Protocol describes a command: title, parameters (@Parameter) and the perform() method with async/await, returning IntentResult.
  • AppEntity and AppEnum are protocols for declaratively describing entities and enumerations, automatically generating UI in Shortcuts.
  • Parameter validation via the validate() method allows checking data before executing the intent and returning Siri dialogs.
  • Integration with Shortcuts and Siri happens automatically after declaring the intent; suggestedInvocationPhrase improves voice recognition.
  • AppIntentsPackage allows executing intents on a server for access to remote data and logic.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also