<!--
{
  "availability" : [
    "macOS: 10.14.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/PhotosUI/PHProjectTypeDescriptionDataSource/extensionWillDiscardDataSource()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PhotosUI"
    ],
    "preciseIdentifier" : "c:objc(pl)PHProjectTypeDescriptionDataSource(im)extensionWillDiscardDataSource"
  },
  "title" : "extensionWillDiscardDataSource()"
}
-->

# extensionWillDiscardDataSource()

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

```
optional func extensionWillDiscardDataSource()
```

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)