Assistant schema conformance for app intents that offer journaling functionality.
Members (5)
get · iOS 16.0+
createEntry
Swift declaration
var createEntry: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for creating a journal entry.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.journal.createEntry` schema:
```swift
@AppIntent(schema: .journal.createEntry)
struct CreateJournalEntryIntent: AppIntent {
@Parameter
var message: AttributedString
@Parameter
var title: String?
@Parameter
var entryDate: Date?
@Parameter
var location: CLPlacemark?
@Parameter(default: [])
var mediaItems: [IntentFile]
func perform() async throws -> some ReturnsValue<JournalEntity> {
.result(value: JournalEntity())
}
}
```
For more information about the `.journal` app intent domain,
see <doc:app-schema-domain-journaling>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
deleteEntry
Swift declaration
var deleteEntry: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for deleting a journal entry.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.journal.deleteEntry` schema:
```swift
@AppIntent(schema: .journal.deleteEntry)
struct DeleteJournalEntryIntent: DeleteIntent {
@Parameter var entities: [JournalEntity]
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.journal` app intent domain,
see <doc:app-schema-domain-journaling>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
updateEntry
Swift declaration
var updateEntry: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for updating a journal entry.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.journal.updateEntry` schema:
```swift
@AppIntent(schema: .journal.updateEntry)
struct UpdateJournalEntryIntent: AppIntent {
@Parameter
var target: JournalEntity
@Parameter
var title: String?
@Parameter
var message: AttributedString?
@Parameter
var mediaItems: [IntentFile]?
@Parameter
var entryDate: Date?
@Parameter
var location: CLPlacemark?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.journal` app intent domain,
see <doc:app-schema-domain-journaling>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
createAudioEntry
Swift declaration
var createAudioEntry: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for creating a voice journal entry.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.journal.createAudioEntry` schema:
```swift
@AppIntent(schema: .journal.createAudioEntry)
struct CreateAudioEntryIntent: AudioRecordingIntent {
func perform() async throws -> some ReturnsValue<JournalEntity> {
.result(value: JournalEntity())
}
}
```
For more information about the `.journal` app intent domain,
see <doc:app-schema-domain-journaling>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
search
Swift declaration
var search: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for searching in journal entries.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.journal.search` schema:
```swift
@AppIntent(schema: .journal.search)
struct SearchJournalEntriesIntent: ShowInAppSearchResultsIntent {
static var searchScopes: [StringSearchScope] = [.general]
@Parameter
var criteria: StringSearchCriteria
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.journal` app intent domain,
see <doc:app-schema-domain-journaling>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.