application(_:shouldRestoreSecureApplicationState:)
Asks the delegate whether to restore the app’s saved state.
Declaration
optional func application(_ application: UIApplication, shouldRestoreSecureApplicationState coder: NSCoder) -> BoolParameters
- application:
The singleton app object.
- coder:
A keyed archiver containing the app’s previously saved state. The coder’s Requiressecurecoding property is set to True, and any objects you decode must adopt Nssecurecoding.
Return Value
Discussion
Apps must implement both this method and 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 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 NSSecureCoding protocol.
This method supersedes application(_:shouldRestoreApplicationState:). If your delegate implements both methods, the system only calls this one.
See Also
Managing app state restoration
application(_:shouldSaveSecureApplicationState:)application(_:viewControllerWithRestorationIdentifierPath:coder:)application(_:willEncodeRestorableStateWith:)application(_:didDecodeRestorableStateWith:)stateRestorationBundleVersionKeystateRestorationSystemVersionKeystateRestorationTimestampKeystateRestorationUserInterfaceIdiomKeystateRestorationViewControllerStoryboardKey