Contents

theme

The theme for rendering a book.

Declaration

var theme: some AssistantSchemas.Enum { get }

Overview

Use Swift macros that generate additional properties and add protocol conformance for your app enum implementation.

The following example shows an app enum that conforms to the .books.theme schema:

@AppEnum(schema: .books.theme)
enum BookTheme: AppEnum {
    case lightMode
    case darkMode
    case theme1

    static var caseDisplayRepresentations: [BookTheme: AppIntents.DisplayRepresentation] = [
        .lightMode: "Light Mode",
        .darkMode: "Dark Mode",
        .theme1: "Theme 1",
    ]
}

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