Instance Property


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


var requiresSecureCoding: Bool { get set }



true if the receiver requires NSSecureCoding; false if not.


If you set the receiver to require secure coding, it will throw an exception if you attempt to archive a class which does not conform to NSSecureCoding.

Note that the getter is on the superclass, NSCoder. See NSCoder for more information about secure coding.

See Also

Archiving Data

class func archivedData(withRootObject: Any) -> Data

Returns an NSData object containing the encoded form of the object graph whose root object is given.

class func archiveRootObject(Any, toFile: String) -> Bool

Archives an object graph rooted at a given object by encoding it into a data object then atomically writes the resulting data object to a file at a given path, and returns a Boolean value that indicates whether the operation was successful.

func finishEncoding()

Instructs the receiver to construct the final data stream.

var outputFormat: PropertyListSerialization.PropertyListFormat

The format in which the receiver encodes its data.

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