---
title: UIStateRestoring
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uistaterestoring
---

# UIStateRestoring

Methods for adding objects to your state restoration archives.

## Declaration

```swift
@MainActor protocol UIStateRestoring : NSObjectProtocol
```

## Mentioned in

About the UI preservation process

## Overview

Overview You can add state restoring objects to an archive directly or by referencing them from another object that’s preserved, such as a view controller. The methods of the protocol let you save enough information about the object to find or recreate it during the next launch cycle. When adopting this protocol in your custom objects, you must also remember to register those objects using the registerObject(forStateRestoration:restorationIdentifier:) method of the UIApplication class. You don’t need to register views or view controllers explicitly because UIKit registers those objects automatically. View controllers adopt this protocol so that they may be used as the restoration parent of one of your custom objects.

## Topics

### Accessing the object information

- [restorationParent](uikit/uistaterestoring/restorationparent.md)
- [objectRestorationClass](uikit/uistaterestoring/objectrestorationclass.md)

### Encoding and decoding the object

- [encodeRestorableState(with:)](uikit/uistaterestoring/encoderestorablestate(with:).md)
- [decodeRestorableState(with:)](uikit/uistaterestoring/decoderestorablestate(with:).md)
- [applicationFinishedRestoringState()](uikit/uistaterestoring/applicationfinishedrestoringstate().md)

### Constants

- [State restoration keys](uikit/state-restoration-keys.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [UIActivityViewController](uikit/uiactivityviewcontroller.md)
- [UIAlertController](uikit/uialertcontroller.md)
- [UICloudSharingController](uikit/uicloudsharingcontroller.md)
- [UICollectionViewController](uikit/uicollectionviewcontroller.md)
- [UIColorPickerViewController](uikit/uicolorpickerviewcontroller.md)
- [UIDocumentBrowserViewController](uikit/uidocumentbrowserviewcontroller.md)
- [UIDocumentMenuViewController](uikit/uidocumentmenuviewcontroller.md)
- [UIDocumentPickerExtensionViewController](uikit/uidocumentpickerextensionviewcontroller.md)
- [UIDocumentPickerViewController](uikit/uidocumentpickerviewcontroller.md)
- [UIDocumentViewController](uikit/uidocumentviewcontroller.md)
- [UIFontPickerViewController](uikit/uifontpickerviewcontroller.md)
- [UIImagePickerController](uikit/uiimagepickercontroller.md)
- [UIInputViewController](uikit/uiinputviewcontroller.md)
- [UINavigationController](uikit/uinavigationcontroller.md)
- [UIPageViewController](uikit/uipageviewcontroller.md)
- [UIReferenceLibraryViewController](uikit/uireferencelibraryviewcontroller.md)
- [UISearchContainerViewController](uikit/uisearchcontainerviewcontroller.md)
- [UISearchController](uikit/uisearchcontroller.md)
- [UISplitViewController](uikit/uisplitviewcontroller.md)
- [UITabBarController](uikit/uitabbarcontroller.md)
- [UITableViewController](uikit/uitableviewcontroller.md)
- [UITextFormattingViewController](uikit/uitextformattingviewcontroller.md)
- [UIVideoEditorController](uikit/uivideoeditorcontroller.md)
- [UIViewController](uikit/uiviewcontroller.md)

## See Also

### Interface restoration

- [Restoring your app’s state](uikit/restoring-your-app-s-state.md)
- [Restoring your app’s state with SwiftUI](swiftui/restoring-your-app-s-state-with-swiftui.md)
- [Preserving your app’s UI across launches](uikit/preserving-your-app-s-ui-across-launches.md)
- [UIViewControllerRestoration](uikit/uiviewcontrollerrestoration.md)
- [UIObjectRestoration](uikit/uiobjectrestoration.md)
