Open Class Methodswift 6.0.3Foundation

archiveRootObject(_:toFile:)

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.

This declaration has been renamed to NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:).

This declaration was deprecated in Swift 9999.

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

Parameters

rootObject

The root of the object graph to archive.

path

The path of the file in which to write the archive.

Returns

true if the operation was successful, otherwise false.