Assistant schema conformance for app intents that offer camera functionality.
Members (5)
get · iOS 16.0+
stopCapture
Swift declaration
var stopCapture: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for stopping the capture of a photo or video.
## 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 `.camera.stopCapture` schema:
```swift
@AppIntent(schema: .camera.stopCapture)
struct StopCaptureIntent: AppIntent {
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.camera` app intent domain,
see <doc:app-schema-domain-camera>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
startCapture
Swift declaration
var startCapture: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for starting the capture of a photo or video.
## 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 `.camera.startCapture` schema:
```swift
@AppIntent(schema: .camera.startCapture)
struct StartCameraCaptureIntent: AppIntent {
@Parameter
var captureMode: CaptureMode
@Parameter
var timerDuration: CaptureDuration?
@Parameter
public var device: CaptureDevice?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.camera` app intent domain,
see <doc:app-schema-domain-camera>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
switchDevice
Swift declaration
var switchDevice: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for switching between cameras or devices.
## 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 `.camera.switchDevice` schema:
```swift
@AppIntent(schema: .camera.switchDevice)
struct FlipCameraIntent: AppIntent {
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.camera` app intent domain,
see <doc:app-schema-domain-camera>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
openInCaptureMode
Swift declaration
var openInCaptureMode: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for opening the app’s camera functionality, ready to capture a photo or video.
## 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 `.camera.openInCaptureMode` schema:
```swift
@AppIntent(schema: .camera.openInCaptureMode)
struct NavigateToCaptureModeIntent: OpenIntent {
@Parameter
var target: CaptureMode
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.camera` app intent domain,
see <doc:app-schema-domain-camera>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
setDevice
Swift declaration
var setDevice: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for choosing a device to capture a photo.
## 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 `.camera.setDevice` schema:
```swift
@AppIntent(schema: .camera.setDevice)
struct SetActiveDeviceIntent: AppIntent {
@Parameter var device: CaptureDevice
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.camera` app intent domain,
see <doc:app-schema-domain-camera>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.