setDataProvider(_:forTypes:)
Sets the data provider for the specified types.
Declaration
func setDataProvider(_ dataProvider: any NSPasteboardItemDataProvider, forTypes types: [NSPasteboard.PasteboardType]) -> BoolParameters
- dataProvider:
A pasteboard data provider.
- types:
An array of strings indicating the UTIs for the data representations
dataProvidermay provide.
Return Value
true if the data provider was set successfully, otherwise false.
Discussion
This method registers the data provider to be messaged to provide the data for any of the specified types when requested.