---
title: extensionWillDiscardDataSource()
framework: photosui
role: symbol
role_heading: Instance Method
path: photosui/phprojecttypedescriptiondatasource/extensionwilldiscarddatasource()
---

# extensionWillDiscardDataSource()

Provides an opportunity to use the data source before it’s released.

## Declaration

```swift
optional func extensionWillDiscardDataSource()
```

## Discussion

Discussion After this call, the extension context no longer strongly references the data source. Fetch any last data you need here before the data source goes out of scope.
