Contents

replace(_:with:)

Causes the receiver to substitute one given object for another whenever the latter is extracted from the archive.

Declaration

func replace(_ object: Any, with newObject: Any)

Parameters

  • object:

    The archived object to replace.

  • newObject:

    The object with which to replace object.

Discussion

newObject can be of a different class from object, and the class mappings set by classNameDecoded(forArchiveClassName:) and decodeClassName(_:asClassName:) are ignored.

See Also

Substituting classes or objects