Contents

UIStateRestoring

Methods for adding objects to your state restoration archives.

Declaration

@MainActor protocol UIStateRestoring : NSObjectProtocol

Mentioned in

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

Encoding and decoding the object

Constants

See Also

Interface restoration