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

# decodeRestorableState(with:)

Decodes and restores state-related information for the object.

```
optional 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 can implement this method on any object for which you also overrode the [`encodeRestorableState(with:)`](/documentation/UIKit/UIStateRestoring/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:)`](/documentation/UIKit/UIStateRestoring/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)