---
title: "accommodatePresentedItemEviction(completionHandler:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsfilepresenter/accommodatepresenteditemeviction(completionhandler:)"
---

# accommodatePresentedItemEviction(completionHandler:)

Given that something in the system is waiting to evict the presented file or directory, do whatever it takes to ensure that the eviction will succeed and that the receiver’s application will behave properly when the eviction has happened, and then invoke the completion handler. This must include calling +[NSFileCoordinator removeFilePresenter:]. You may instead prevent eviction by passing the completion handler a meaningful error.

## Declaration

```swift
optional func accommodatePresentedItemEviction(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
optional func accommodatePresentedItemEviction() async throws
```

## Discussion

Discussion If this method is not implemented, eviction will fail.
