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

# decodeRestorableState(with:)

Decodes and restores state-related information for the view.

## Declaration

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

## Parameters

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

## Discussion

Discussion If your app supports state restoration, you should override this method for any views for which you also overrode the encodeRestorableState(with:) method. Your implementation of this method should use any saved state information to restore the view 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

### Preserving and restoring state

- [restorationIdentifier](uikit/uiview/restorationidentifier.md)
- [encodeRestorableState(with:)](uikit/uiview/encoderestorablestate(with:).md)
