Assistant schema conformance for app entities that describe media assets.
Members (3)
get · iOS 16.0+
recognizedPerson
Swift declaration
var recognizedPerson: some AssistantSchemas.Entity { get }
The app entity describes a person who appears in an asset.
## 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 `.photos.recognizedPerson` schema:
```swift
@AppEntity(schema: .photos.recognizedPerson)
struct PhotoPersonEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [PhotoPersonEntity.ID]) async throws -> [PhotoPersonEntity] { [] }
func entities(matching string: String) async throws -> [PhotoPersonEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Photo Person" }
let id = UUID()
@Property
var name: String
@Property
var isFavorite: Bool
}
```
For more information about the `.photos` app intent domain,
see <doc:app-schema-domain-photos>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
album
Swift declaration
var album: some AssistantSchemas.Entity { get }
The app entity describes an album.
## 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 `.photos.album` schema:
```swift
@AppEntity(schema: .photos.album)
struct PhotoAlbumEntity: AppEntity {
struct Query: EntityStringQuery {
func entities(for identifiers: [PhotoAlbumEntity.ID]) async throws -> [PhotoAlbumEntity] { [] }
func entities(matching string: String) async throws -> [PhotoAlbumEntity] { [] }
}
static var defaultQuery = Query()
var displayRepresentation: DisplayRepresentation { "Photo Album" }
let id = UUID()
@Property
var name: String
@Property
var creationDate: Date?
@Property
var albumType: PhotoAlbumType
}
```
For more information about the `.photos` app intent domain,
see <doc:app-schema-domain-photos>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
asset
Swift declaration
var asset: some AssistantSchemas.Entity { get }
## Overview
To integrate your app’s functionality with Siri and Apple Intelligence,
you use Swift macros that generate additional properties and add protocol conformance
for your app entity implementation.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
The following example shows an app entity that conforms to the `photos.asset` schema:
```swift
@AppEntity(schema: .photos.asset)
struct PhotoEntity: CollaborativeEntity {
struct PhotoEntityQuery: EntityQuery {
func entities(for identifiers: [PhotoEntity.ID]) async throws -> [PhotoEntity] {
<#code#>
}
}
static let defaultQuery = PhotoEntityQuery()
static var sharedWith = <#[IntentPerson]#>
let displayRepresentation: DisplayRepresentation = {
<#DisplayRepresentation#>
}
var creationDate: Date?
var location: GeoToolbox.PlaceDescriptor?
var assetType: <#PhotoAssetType#>?
var isFavorite: Bool
var isHidden: Bool
var hasSuggestedEdits: Bool
var aperture: Double?
var exposure: Double?
var saturation: Double?
var warmth: Double?
var filter: <#PhotoFilterEffectType#>?
var isPortraitModeEnabled: Bool?
let id: <#Identifiable.ID#>
}
```