Contents

replacementObject(for:)

Overridden by subclasses to substitute another object for itself during keyed archiving.

Declaration

func replacementObject(for archiver: NSKeyedArchiver) -> Any?

Parameters

  • archiver:

    A keyed archiver creating an archive.

Return Value

The object encode instead of the receiver (if different).

Discussion

This method is called only if no replacement mapping for the object has been set up in the encoder (for example, due to a previous call of replacementObject(for:) to that object).

See Also

Archiving