Contents

createPage

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

Declaration

var createPage: 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.createPage schema:

@AppIntent(schema: .wordProcessor.createPage)
struct CreateWordProcessorPageIntent: AppIntent {
    @Parameter
    var target: WordProcessorDocumentEntity

    @Parameter
    var template: String?

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

See Also

Actions