window
The app entity describes a browser window.
Declaration
var window: 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 .browser.window schema:
@AppEntity(schema: .browser.window)
struct WindowEntity: AppEntity {
static var defaultQuery = Query()
let id = UUID()
@Property
var tabs: [TabEntity]
@Property
var isPrivate: Bool
var displayRepresentation: AppIntents.DisplayRepresentation { "Window" }
struct Query: EntityStringQuery {
func entities(for identifiers: [WindowEntity.ID]) async throws -> [WindowEntity] { [] }
func entities(matching string: String) async throws -> [WindowEntity] { [] }
}
}For more information about the .browser app intent domain, see Making browser actions available to Siri and Apple Intelligence. For general information about app intent domains, see Integrating actions with Siri and Apple Intelligence.