---
title: extensionWillTerminate()
framework: backgroundassets
role: symbol
role_heading: Instance Method
path: backgroundassets/badownloaderextension-qwaw/extensionwillterminate()
---

# extensionWillTerminate()

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

## Declaration

```swift
func extensionWillTerminate()
```

## Discussion

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.

## See Also

### Reacting to extension events

- [extensionWillTerminate()](backgroundassets/badownloaderextension-qwaw/extensionwillterminate()-236ac.md)
