Type Method

setClass(_:forClassName:)

Adds a class translation mapping to NSKeyedUnarchiver whereby objects encoded with a given class name are decoded as instances of a given class instead.

Declaration

class func setClass(_ cls: AnyClass?, forClassName codedName: String)

Parameters

cls

The class with which to replace instances of the class named codedName.

codedName

The ostensible name of a class in an archive.

Discussion

When decoding, the class’s translation mapping is used only if no translation is found first in an instance’s separate translation map.

See Also

Managing Class Names

class func `class`(forClassName: String) -> AnyClass?

Returns the class from which NSKeyedUnarchiver instantiates an encoded object with a given class name.

func setClass(AnyClass?, forClassName: String)

Adds a class translation mapping to the receiver whereby objects encoded with a given class name are decoded as instances of a given class instead.

func `class`(forClassName: String) -> AnyClass?

Returns the class from which the receiver instantiates an encoded object with a given class name.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software