<!--
{
  "availability" : [
    "iOS: 13.2.0 -",
    "iPadOS: 13.2.0 -",
    "macCatalyst: 13.2.0 -",
    "tvOS: 13.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplicationDelegate/application(_:shouldRestoreSecureApplicationState:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIApplicationDelegate(im)application:shouldRestoreSecureApplicationState:"
  },
  "title" : "application(_:shouldRestoreSecureApplicationState:)"
}
-->

# application(_:shouldRestoreSecureApplicationState:)

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

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

## Parameters

`application`

The singleton app object.

`coder`

A keyed archiver containing the app’s previously saved state. The coder’s <doc://com.apple.documentation/documentation/Foundation/NSCoder/requiresSecureCoding> property is set to <doc://com.apple.documentation/documentation/Swift/true>, and any objects you decode must adopt <doc://com.apple.documentation/documentation/Foundation/NSSecureCoding>.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to restore the app’s saved state; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Apps must implement both this method and [`application(_:shouldSaveSecureApplicationState:)`](/documentation/UIKit/UIApplicationDelegate/application(_:shouldSaveSecureApplicationState:)) for state preservation to occur.

Use the information from the provided coder to determine whether to proceed with state restoration. For example, you might return <doc://com.apple.documentation/documentation/Swift/false> if the data in the coder is from an earlier version of your app and you can’t restore it safely. Any objects you decode from the coder must adopt the <doc://com.apple.documentation/documentation/Foundation/NSSecureCoding> protocol.

This method supersedes [`application(_:shouldRestoreApplicationState:)`](/documentation/UIKit/UIApplicationDelegate/application(_:shouldRestoreApplicationState:)). If your delegate implements both methods, the system only calls this one.

---

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)