Contents

settings

The app entity describes settings for an audiobook or ebook.

Declaration

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

@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 Making ebook actions available to Siri and Apple Intelligence. For general information about app intent domains, see Integrating actions with Siri and Apple Intelligence.

See Also

Content and parameter types