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 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.
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.
| Characteristic | Intents framework | AppIntent |
|---|---|---|
| Code volume | 100–300 lines per intent | 30–60 lines |
| Required files | .intentdefinition, Extension, Config | 1 Swift file |
| Code generation | Required (Xcode -> ObjC) | Not required |
| Asynchrony | Completion handler only | async/await + progress |
| IntentDialog | No | Built-in Siri dialogs |
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.
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")
}
}
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.
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!")
}
}
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.
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)
}
}
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.
| Category | Example | Behavior in Shortcuts |
|---|---|---|
| .create | CreateTaskIntent | Groups with other creation actions |
| .view | ViewWeatherIntent | Displayed in the "View" category |
| .search | SearchNotesIntent | Marked as a search action |
| .edit | UpdateTaskIntent | Groups with editing actions |
Frequently Asked Questions
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.
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.
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.
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.
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
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.
Read also