<!--
{
  "documentType" : "article",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/providing-support-for-user-driven-actions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Providing support for user-driven actions"
}
-->

# Providing support for user-driven actions

Override methods to handle user-initiated actions.

## Discussion

When the user performs an action in the document browser (for example, moving, renaming, or deleting an item) the system calls the corresponding method on your [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) subclass.

The following table shows the action method for each action type:

|User action                                |Action method                                                                                                                                                         |
|-------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|Creates a new folder                       |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/createDirectory(withName:inParentItemIdentifier:completionHandler:)``               |
|Deletes a document or folder               |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/deleteItem(withIdentifier:completionHandler:)``                                     |
|Imports a document                         |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/importDocument(at:toParentItemIdentifier:completionHandler:)``                      |
|Renames a document or folder               |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/renameItem(withIdentifier:toName:completionHandler:)``                              |
|Moves a document or folder                 |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/reparentItem(withIdentifier:toParentItemWithIdentifier:newName:completionHandler:)``|
|Sets or changes a folder’s favorite rank   |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/setFavoriteRank(_:forItemIdentifier:completionHandler:)``                           |
|Uses a document                            |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/setLastUsedDate(_:forItemIdentifier:completionHandler:)``                           |
|Tags or untags a document or folder        |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/setTagData(_:forItemIdentifier:completionHandler:)``                                |
|Moves a document or folder to the trash    |``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/trashItem(withIdentifier:completionHandler:)``                                      |
|Removes a document or folder from the trash|``doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/untrashItem(withIdentifier:toParentItemIdentifier:completionHandler:)``             |

When the action method is called, ensure that your implementation:

1. Makes any necessary local changes, including updates to the working set
2. Schedules a background update for your server
3. Signals that the changes have occurred
4. Calls the completion handler with the results

All the action methods are expected to work offline, and should return immediately. Call the completion handler before performing any network activity or other long-running tasks. Defer these tasks to the background.

## Topics

### Signaling Changes

[Signaling Changes for User-Driven Actions](/documentation/FileProvider/signaling-changes-for-user-driven-actions)

Signal the system about any changes created by an action.

### Handling Errors

[Handling Errors with User-Driven Actions](/documentation/FileProvider/handling-errors-with-user-driven-actions)

Handle any errors that occur while processing the action.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)