---
title: "application(_:shouldRestoreApplicationState:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiapplicationdelegate/application(_:shouldrestoreapplicationstate:)"
---

# application(_:shouldRestoreApplicationState:)

Asks the delegate whether to restore the app’s saved state.

## Declaration

```swift
optional func application(_ application: UIApplication, shouldRestoreApplicationState coder: NSCoder) -> Bool
```

## Parameters

- `application`: Your singleton app object.
- `coder`: The keyed archiver containing the app’s previously saved state information.

## Mentioned in

About the UI restoration process

## Return Value

Return Value true if the app’s state should be restored; otherwise, false.

## Discussion

Discussion Apps must implement this method and the application(_:shouldSaveApplicationState:) method for state preservation to occur. In addition, your implementation of this method must return true each time UIKit tries to restore the state of your app. You can use the information in the provided coder object to decide whether or not to proceed with state restoration. For example, you might return false if the data in the coder is from a different version of your app and can’t be effectively restored to the current version.

## See Also

### Deprecated

- [application(_:didRegister:)](uikit/uiapplicationdelegate/application(_:didregister:).md)
- [application(_:didReceive:)](uikit/uiapplicationdelegate/application(_:didreceive:).md)
- [application(_:didReceiveRemoteNotification:)](uikit/uiapplicationdelegate/application(_:didreceiveremotenotification:).md)
- [application(_:handleActionWithIdentifier:for:completionHandler:)](uikit/uiapplicationdelegate/application(_:handleactionwithidentifier:for:completionhandler:).md)
- [application(_:handleActionWithIdentifier:for:withResponseInfo:completionHandler:)](uikit/uiapplicationdelegate/application(_:handleactionwithidentifier:for:withresponseinfo:completionhandler:).md)
- [application(_:handleActionWithIdentifier:forRemoteNotification:completionHandler:)](uikit/uiapplicationdelegate/application(_:handleactionwithidentifier:forremotenotification:completionhandler:).md)
- [application(_:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:)](uikit/uiapplicationdelegate/application(_:handleactionwithidentifier:forremotenotification:withresponseinfo:completionhandler:).md)
- [application(_:handleOpen:)](uikit/uiapplicationdelegate/application(_:handleopen:).md)
- [application(_:open:sourceApplication:annotation:)](uikit/uiapplicationdelegate/application(_:open:sourceapplication:annotation:).md)
- [application(_:willChangeStatusBarOrientation:duration:)](uikit/uiapplicationdelegate/application(_:willchangestatusbarorientation:duration:).md)
- [application(_:didChangeStatusBarOrientation:)](uikit/uiapplicationdelegate/application(_:didchangestatusbarorientation:).md)
- [application(_:willChangeStatusBarFrame:)](uikit/uiapplicationdelegate/application(_:willchangestatusbarframe:).md)
- [application(_:didChangeStatusBarFrame:)](uikit/uiapplicationdelegate/application(_:didchangestatusbarframe:).md)
- [application(_:handle:completionHandler:)](uikit/uiapplicationdelegate/application(_:handle:completionhandler:).md)
- [application(_:performFetchWithCompletionHandler:)](uikit/uiapplicationdelegate/application(_:performfetchwithcompletionhandler:).md)
