Contents

page

The app entity describes a page.

Declaration

var page: some AssistantSchemas.Entity { get }

Overview

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

@AppEntity(schema: .reader.page)
struct ReaderPageEntity: AppEntity {
    struct Query: EntityStringQuery {
        func entities(for identifiers: [ReaderPageEntity.ID]) async throws -> [ReaderPageEntity] { [] }
        func entities(matching string: String) async throws -> [ReaderPageEntity] { [] }
    }
    static var defaultQuery = Query()
    var displayRepresentation: DisplayRepresentation { "Page" }

    let id = UUID()

    @Property var label: String
}

For more information about the .reader app intent domain, see doc:Making-document-reader-actions-available-to-siri-and-apple-intelligence. For general information about app intent domains, see doc:Integrating-actions-with-siri-and-apple-intelligence.