<!--
{
  "availability" : [
    "iOS: 16.1.0 - 16.4.0",
    "iPadOS: 16.1.0 - 16.4.0",
    "macCatalyst: 16.1.0 - 16.4.0",
    "macOS: 13.0.0 - 13.3.0",
    "visionOS: 2.4.0 - 2.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "BackgroundAssets",
  "identifier" : "/documentation/BackgroundAssets/BADownloaderExtension-qwaw/extensionWillTerminate()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Background Assets"
    ],
    "preciseIdentifier" : "s:16BackgroundAssets21BADownloaderExtensionP22extensionWillTerminateyyF"
  },
  "title" : "extensionWillTerminate()"
}
-->

# extensionWillTerminate()

This method may be called shortly before the extension is terminated.

```
func extensionWillTerminate()
```

## Discussion

This method is invoked if all extension callbacks have returned or if the extension has run over it’s alotted runtime.
This callback provides a last chance to tidy up state before process termination.

> Warning: This method is advisory only, there will be instances where the extension is terminated before this method is invoked.
> Do not rely on this method being invoked before the extension is terminated.

---

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)