replace(_:with:)
Causes the receiver to treat subsequent requests to encode a given object as though they were requests to encode another given object.
Declaration
func replace(_ object: Any, with newObject: Any)Parameters
- object:
An object in the object graph being archived.
- newObject:
The object with which to replace
objectin the archive.
Discussion
Both object and newObject must be valid objects.