<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSKeyedUnarchiverDelegate/unarchiver(_:didDecode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSKeyedUnarchiverDelegate(im)unarchiver:didDecodeObject:"
  },
  "title" : "unarchiver(_:didDecode:)"
}
-->

# unarchiver(_:didDecode:)

Informs the delegate that a given object has been decoded.

```
optional func unarchiver(_ unarchiver: NSKeyedUnarchiver, didDecode object: consuming Any?) -> Any?
```

## Parameters

`unarchiver`

An unarchiver for which the receiver is the delegate.

`object`

The object that has been decoded. `object` may be `nil`.

## Return Value

The object to use in place of `object`. The delegate can either return `object` or return a different object to replace the decoded one. In apps using ARC, the delegate should only return `nil` if `object` itself is `nil`. In apps not using ARC, the delegate can return `nil` to indicate that the decoded value is unchanged—that is, `object` will be decoded.

## Discussion

This method is called after `object` has been sent [`init(coder:)`](/documentation/Foundation/NSCoding/init(coder:)) and <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/awakeAfter(using:)>.

The delegate may use this method to keep track of the decoded objects.

---

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)