<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/decodeRestorableState(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIView(im)decodeRestorableStateWithCoder:"
  },
  "title" : "decodeRestorableState(with:)"
}
-->

# decodeRestorableState(with:)

Decodes and restores state-related information for the view.

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

## Parameters

`coder`

The coder object to use to decode the state of the view.

## Discussion

If your app supports state restoration, you should override this method for any views for which you also overrode the [`encodeRestorableState(with:)`](/documentation/UIKit/UIView/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:)`](/documentation/UIKit/UIView/encodeRestorableState(with:)) method called `super`, this method should similarly call `super` at some point in its implementation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)