Initializer

init(pasteboard​Property​List:​of​Type:​)

Required.

Initializes an instance with a property list object and a type string.

Declaration

init?(pasteboardPropertyList propertyList: Any, ofType type: String)

Parameters

property​List

A property list containing data to initialize the receiver.

By default, the property list object is an instance of NSData. If you implement reading​Options(for​Type:​pasteboard:​) and specify an option other than as​Data, the property​List may be any other property list object.

type

A UTI supported by the receiver for reading (one of the types returned by readable​Types(for:​)).

Return Value

An object initialized using the data in property​List.

Discussion

This method is considered optional because, if readable​Types(for:​) returns just a single type, and that type uses the as​Keyed​Archive reading option, then instances are initialized using init(coder:​) instead of this method.