Instance Method


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


optional func archiver(_ archiver: NSKeyedArchiver, willReplace object: Any?, with newObject: Any?)



The archiver that sent the message.


The object being replaced in the archive.


The object replacing object in the archive.


This method is called even when the delegate itself is doing, or has done, the substitution. The delegate may use this method if it is keeping track of the encoded or decoded objects.

See Also

Encoding Data and Objects

func archiver(NSKeyedArchiver, didEncode: Any?)

Informs the delegate that a given object has been encoded.

func archiverDidFinish(NSKeyedArchiver)

Notifies the delegate that encoding has finished.

func archiver(NSKeyedArchiver, willEncode: Any) -> Any?

Informs the delegate that object is about to be encoded.

func archiverWillFinish(NSKeyedArchiver)

Notifies the delegate that encoding is about to finish.