Assistant schema conformance for app intents that offer file management functionality.
Members (5)
get · iOS 16.0+
moveFiles
Swift declaration
var moveFiles: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for moving a file.
## 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 `.files.moveFiles` schema:
```swift
@AppIntent(schema: .files.moveFiles)
struct MoveFilesIntent: AppIntent {
@Parameter
var entities: [ExampleFileEntity]
@Parameter
var destinationFolder: ExampleFileEntity
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.files` app intent domain,
see <doc:app-schema-domain-files>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
deleteFiles
Swift declaration
var deleteFiles: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for deleting files.
## 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 `.files.deleteFiles` schema:
```swift
@AppIntent(schema: .files.deleteFiles)
struct DeleteFilesIntent: DeleteIntent {
@Parameter
var entities: [ExampleFileEntity]
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.files` app intent domain,
see <doc:app-schema-domain-files>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
renameFile
Swift declaration
var renameFile: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for renaming a file.
## 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 `.files.renameFile` schema:
```swift
@AppIntent(schema: .files.renameFile)
struct RenameFileIntent: AppIntent {
@Parameter
var target: ExampleFileEntity
@Parameter
var newName: String?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.files` app intent domain,
see <doc:app-schema-domain-files>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
createFolder
Swift declaration
var createFolder: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for creating a folder.
## 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 `.files.createFolder` schema:
```swift
@AppIntent(schema: .files.createFolder)
struct CreateFolderIntent: AppIntent {
@Parameter
var target: ExampleFileEntity
@Parameter
var fileName: String?
func perform() async throws -> some ReturnsValue<ExampleFileEntity> {
let url = URL(fileURLWithPath: "some/path")
return .result(
value: ExampleFileEntity(id: try .file(url: url))
)
}
}
```
For more information about the `.files` app intent domain,
see <doc:app-schema-domain-files>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
openFile
Swift declaration
var openFile: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for opening a file.
## 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 `.files.openFile` schema:
```swift
@AppIntent(schema: .files.openFile)
struct OpenFileIntent: OpenIntent {
@Parameter
var target: ExampleFileEntity
func perform() async throws -> some IntentResult {
return .result()
}
}
```
For more information about the `.files` app intent domain,
see <doc:app-schema-domain-files>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.