setClassName(_:for:)
Sets a global translation mapping to encode instances of a given class with the provided name, rather than their real name.
Declaration
class func setClassName(_ codedName: String?, for cls: AnyClass)Parameters
- codedName:
The name of the class that
NSKeyedArchiveruses in place ofcls. - cls:
The class for which to set up a translation mapping.
Discussion
When encoding, an archiver consults its own translation map before using the class’ translation map.