Assistant schema conformance for app entities that describe ebooks or audiobooks.
Members (3)
get · iOS 16.0+
book
Swift declaration
var book: some AssistantSchemas.Entity { get }
The app entity describes an ebook.
## 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 `.books.book` schema:
```swift
@AppEntity(schema: .books.book)
struct BookEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [BookEntity.ID]) async throws -> [BookEntity] { [] }
func entities(matching string: String) async throws -> [BookEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Book" }
let id = UUID()
@Property
var title: String?
@Property
var seriesTitle: String?
@Property
var author: String?
@Property
var genre: String?
@Property
var purchaseDate: Date?
@Property
var contentType: BookContentType?
}
```
For more information about the `.books` app intent domain,
see <doc:app-schema-domain-books>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
settings
Swift declaration
var settings: some AssistantSchemas.Entity { get }
The app entity describes settings for an audiobook or ebook.
## 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 `.books.settings` schema:
```swift
@AppEntity(schema: .books.settings)
struct BookSettingsEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [BookSettingsEntity.ID]) async throws -> [BookSettingsEntity] { [] }
func entities(matching string: String) async throws -> [BookSettingsEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Book Settings" }
let id = UUID()
@Property
var font: BookFont
@Property
var fontSize: BookFontSize
@Property
var theme: BookTheme
@Property
var pageNavigationSetting: BookPageNavigationSetting
@Property
var isTextJustified: Bool
@Property
var isAllowMultipleColumns: Bool}
```
For more information about the `.books` app intent domain,
see <doc:app-schema-domain-books>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
audiobook
Swift declaration
var audiobook: some AssistantSchemas.Entity { get }
The app entity describes an audiobook.
## 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 `.books.audiobook` schema:
```swift
@AppEntity(schema: .books.audiobook)
struct AudiobookEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [AudiobookEntity.ID]) async throws -> [AudiobookEntity] { [] }
func entities(matching string: String) async throws -> [AudiobookEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Audiobook" }
let id = UUID()
@Property
var title: String?
@Property
var seriesTitle: String?
@Property
var author: String?
@Property
var genre: String?
@Property
var purchaseDate: Date?
}
```
For more information about the `.books` app intent domain,
see <doc:app-schema-domain-books>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.