<!--
{
  "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/NSKeyedArchiverDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSKeyedArchiverDelegate"
  },
  "title" : "NSKeyedArchiverDelegate"
}
-->

# NSKeyedArchiverDelegate

The optional methods implemented by the delegate of a keyed archiver.

```
protocol NSKeyedArchiverDelegate : NSObjectProtocol
```

## Topics

### Encoding Data and Objects

[`archiver(_:didEncode:)`](/documentation/Foundation/NSKeyedArchiverDelegate/archiver(_:didEncode:))

Informs the delegate that a given object has been encoded.

[`archiverDidFinish(_:)`](/documentation/Foundation/NSKeyedArchiverDelegate/archiverDidFinish(_:))

Notifies the delegate that encoding has finished.

[`archiver(_:willEncode:)`](/documentation/Foundation/NSKeyedArchiverDelegate/archiver(_:willEncode:))

Informs the delegate that `object` is about to be encoded.

[`archiverWillFinish(_:)`](/documentation/Foundation/NSKeyedArchiverDelegate/archiverWillFinish(_:))

Notifies the delegate that encoding is about to finish.

[`archiver(_:willReplace:with:)`](/documentation/Foundation/NSKeyedArchiverDelegate/archiver(_:willReplace:with:))

Informs the delegate that one given object is being substituted for another given object.



---

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)