Instance Method

setClassName(_:for:)

Sets a mapping for this archiver to encode instances of a given class with the provided name, rather than their real name.

Declaration

func setClassName(_ codedName: String?, for cls: AnyClass)

Parameters

codedName

The name of the class that the receiver uses uses in place of cls.

cls

The class for which to set up a translation mapping.

Discussion

When encoding, the receiver’s translation map overrides any translation that may also be present in the class’s map.

See Also

Managing Classes and Class Names

class func setClassName(String?, for: AnyClass)

Sets a global translation mapping to encode instances of a given class with the provided name, rather than their real name.

class func className(for: AnyClass) -> String?

Returns the class name with which the archiver class encodes instances of a given class.

func className(for: AnyClass) -> String?

Returns the class name with which this archiver encodes instances of a given class.