---
title: "presentedSubitem(at:didGain:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsfilepresenter/presentedsubitem(at:didgain:)"
---

# presentedSubitem(at:didGain:)

Tells the delegate that the item inside the presented directory gained a new version.

## Declaration

```swift
optional func presentedSubitem(at url: URL, didGain version: NSFileVersion)
```

## Parameters

- `url`: The URL of the item inside the presented directory that gained a new version. The item need not be at the top level of the presented directory but may itself be inside a nested subdirectory.
- `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 item. This might involve incorporating the version silently or asking the user about how to proceed.

## See Also

### Responding to Version Changes

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