Type Method

unarchiveObject(withFile:)

Decodes and returns the object graph previously encoded by NSKeyedArchiver written to the file at a given path.

Declaration

class func unarchiveObject(withFile path: String) -> Any?

Parameters

path

A path to a file that contains an object graph previously encoded by NSKeyedArchiver.

Return Value

The object graph previously encoded by NSKeyedArchiver written to the file path. Returns nil if there is no file at path.

Discussion

This method raises an invalidArgumentException if the file at path does not contain a valid archive.

See Also

Unarchiving Data

class func unarchiveObject(with: Data)

Decodes and returns the object graph previously encoded by NSKeyedArchiver and stored in a given NSData object.

var requiresSecureCoding: Bool

Indicates whether the receiver requires all unarchived classes to conform to NSSecureCoding.