Assistant schema conformance for app entities that describe documents.
Members (2)
get · iOS 16.0+
page
Swift declaration
var page: some AssistantSchemas.Entity { get }
The app entity describes a page.
## 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:
```swift
@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:app-schema-domain-reader>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
document
Swift declaration
var document: some AssistantSchemas.Entity { get }
The app entity describes a document.
## 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.document` schema:
```swift
@AppEntity(schema: .reader.document)
struct ReaderDocumentEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [ReaderDocumentEntity.ID]) async throws -> [ReaderDocumentEntity] { [] }
func entities(matching string: String) async throws -> [ReaderDocumentEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Document" }
let id = UUID()
@Property
var title: String
@Property
var kind: ReaderDocumentKind
@Property
var width: Int?
@Property
var height: Int?
}
```
For more information about the `.reader` app intent domain,
see <doc:app-schema-domain-reader>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.