archivedData(withRootObject:)
Returns a data object containing the encoded form of the object graph whose root object is given.
Declaration
class func archivedData(withRootObject rootObject: Any) -> DataParameters
- rootObject:
The root object of the object graph to archive.
Return Value
A data object containing the encoded form of the object graph whose root object is rootObject.
Discussion
This method invokes init(forWritingWith:) and encodeRootObject(_:) to create a temporary archiver that encodes the object graph.