tab
The app entity describes a browser tab.
Declaration
var tab: some AssistantSchemas.Entity { get }Mentioned in
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.tab schema:
@AppEntity(schema: .browser.tab)
struct TabEntity: AppEntity {
static var defaultQuery = Query()
let id = UUID()
@Property
var url: URL?
@Property
var name: String
@Property
var isPrivate: Bool
var displayRepresentation: AppIntents.DisplayRepresentation { "Tab" }
struct Query: EntityStringQuery {
func entities(for identifiers: [TabEntity.ID]) async throws -> [TabEntity] { [] }
func entities(matching string: String) async throws -> [TabEntity] { [] }
}
}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.