Type Method

data(fromPropertyList:format:options:)

Returns an NSData object containing a given property list in a specified format.

Declaration

class func data(fromPropertyList plist: Any, format: PropertyListSerialization.PropertyListFormat, options opt: PropertyListSerialization.WriteOptions) throws -> Data

Parameters

plist

A property list object.

format

A property list format. For possible values, see PropertyListSerialization.PropertyListFormat.

opt

The opt parameter is currently unused. No options should be specified.

error

If the method does not complete successfully, upon return contains an NSError object that describes the problem.

Return Value

An NSData object containing plist in the format specified by format.

Discussion