Contents

decodeClassName(_:asClassName:)

Instructs the receiver to use the class with a given name when instantiating objects whose ostensible class, according to the archived data, is another given name.

Declaration

func decodeClassName(_ inArchiveName: String, asClassName trueName: String)

Parameters

  • inArchiveName:

    The ostensible name of a class in an archive.

  • trueName:

    The name of the class to use when instantiating objects whose ostensible class, according to the archived data, is nameInArchive.

Discussion

This method enables easy conversion of unarchived data when the name of a class has changed since the archive was created.

Note that there’s also a class method of the same name. The class method has precedence in case of conflicts.

See Also

Substituting classes or objects