encodeClassName(_:intoClassName:)
Encodes a substitute name for the class with a given true name.
Declaration
func encodeClassName(_ trueName: String, intoClassName inArchiveName: String)Parameters
- trueName:
The real name of a class in the object graph being archived.
- inArchiveName:
The name of the class to use in the archive in place of
trueName.
Discussion
Any subsequently encountered objects of class trueName are archived as instances of class inArchiveName. It is safest not to invoke this method during the archiving process (that is, within an encode(with:) method). Instead, invoke it before encodeRootObject(_:).