Contents

create

The app intent conforms to the schema for creating a text document.

Declaration

var create: some AssistantSchemas.Intent { get }

Overview

Use Swift macros that generate additional properties and add protocol conformance for your app intent implementation. The following example shows an app intent that conforms to the .wordProcessor.create schema:

@AppIntent(schema: .wordProcessor.create)
struct CreateWordProcessorDocumentIntent: AppIntent {
    @Parameter
    var template: WordProcessorDocumentTemplateEntity?

    func perform() async throws -> some ReturnsValue<WordProcessorDocumentEntity> {
        .result(value: WordProcessorDocumentEntity())
    }
}

See Also

Actions