---
title: "decodeRestorableState(with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uistaterestoring/decoderestorablestate(with:)"
---

# decodeRestorableState(with:)

Decodes and restores state-related information for the object.

## Declaration

```swift
optional func decodeRestorableState(with coder: NSCoder)
```

## Parameters

- `coder`: The coder object to use to decode the state of the view.

## Mentioned in

About the UI restoration process

## Discussion

Discussion If your app supports state restoration, you can implement this method on any object for which you also overrode the encodeRestorableState(with:) method. Your implementation of this method should read any saved state information from the archive and use it to restore the object to its previous configuration. If your encodeRestorableState(with:) method called super, this method should similarly call super at some point in its implementation.

## See Also

### Encoding and decoding the object

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