---
title: "modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileproviderreplicatedextension/modifyitem(_:baseversion:changedfields:contents:options:request:completionhandler:)"
---

# modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)

Tells the file provider that an item’s content or metadata changed.

## Declaration

```swift
func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, (any Error)?) -> Void) -> Progress
```

## Parameters

- `item`: The item to modify.
- `version`: The item’s version.
- `changedFields`: The fields that have changed.
- `newContents`: A URL for the local copy of the item’s new contents.
- `options`: The modification options.
- `request`: An object that identifies the context of that request, such as the requesting app.
- `completionHandler`: A block that you call after uploading the changes to your remote storage. You pass the following parameters:

## Return Value

Return Value An item that tracks your extension’s progress.

## Discussion

Discussion The system calls this method when the user modifies an item—for example, moving it, renaming it, or updating its content. The changedFields parameter may contain multiple items, indicating that multiple changes have occurred. Update the version of the item in your remote storage to match, and then call the callback handler.

## See Also

### Managing Items

- [createItem(basedOn:fields:contents:options:request:completionHandler:)](fileprovider/nsfileproviderreplicatedextension/createitem(basedon:fields:contents:options:request:completionhandler:).md)
- [NSFileProviderCreateItemOptions](fileprovider/nsfileprovidercreateitemoptions.md)
- [NSFileProviderModifyItemOptions](fileprovider/nsfileprovidermodifyitemoptions.md)
- [deleteItem(identifier:baseVersion:options:request:completionHandler:)](fileprovider/nsfileproviderreplicatedextension/deleteitem(identifier:baseversion:options:request:completionhandler:).md)
- [NSFileProviderDeleteItemOptions](fileprovider/nsfileproviderdeleteitemoptions.md)
