---
title: "presentedItemDidGain(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsfilepresenter/presenteditemdidgain(_:)"
---

# presentedItemDidGain(_:)

Tells the delegate that a new version of the file or file package was added.

## Declaration

```swift
optional func presentedItemDidGain(_ version: NSFileVersion)
```

## Parameters

- `version`: The file version object containing information about the new file version.

## Discussion

Discussion Your delegate can use this method to determine how to incorporate data from the new version of the file or file package. If the file has not been modified by your code, you might simply update to the new version quietly. However, if your application has its own changes, you might need to ask the user how to proceed.

## See Also

### Responding to Version Changes

- [presentedItemDidLose(_:)](foundation/nsfilepresenter/presenteditemdidlose(_:).md)
- [presentedItemDidResolveConflict(_:)](foundation/nsfilepresenter/presenteditemdidresolveconflict(_:).md)
- [presentedSubitem(at:didGain:)](foundation/nsfilepresenter/presentedsubitem(at:didgain:).md)
- [presentedSubitem(at:didLose:)](foundation/nsfilepresenter/presentedsubitem(at:didlose:).md)
- [presentedSubitem(at:didResolve:)](foundation/nsfilepresenter/presentedsubitem(at:didresolve:).md)
