Instance Method


Asks the delegate whether the app’s state should be preserved.


- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder;



Your singleton app object.


The keyed archiver into which you can put high-level state information.

Return Value

YES if the app’s state should be preserved or NO if it should not.


Apps must implement this method and the application:shouldRestoreApplicationState: method for state preservation to occur. In addition, your implementation of this method must return YES each time UIKit tries to preserve the state of your app. You can return NO to disable state preservation temporarily. For example, during testing, you could disable state preservation to test specific code paths.

You can add version information or any other contextual data to the provided coder object as needed. During restoration, you can use that information to help decide whether or not to proceed with restoring your app to its previous state.

See Also

Managing App State Restoration

- application:shouldRestoreApplicationState:

Asks the delegate whether the app’s saved state information should be restored.

- application:viewControllerWithRestorationIdentifierPath:coder:

Asks the delegate to provide the specified view controller.

- application:willEncodeRestorableStateWithCoder:

Tells your delegate to save any high-level state information at the beginning of the state preservation process.

- application:didDecodeRestorableStateWithCoder:

Tells your delegate to restore any high-level state information as part of the state restoration process.


The version of your app responsible for creating the restoration archive.


The version of the system on which your app created the restoration archive.


The time at which your app created the restoration archive.


The user interface idiom that was in effect when your app created the restoration archive.


A reference to the storyboard that contains the view controller.