Contents

canInit(with:)

Tests whether the image can create an instance of itself using pasteboard data.

Declaration

class func canInit(with pasteboard: NSPasteboard) -> Bool

Parameters

  • pasteboard:

    The pasteboard containing the image data.

Return Value

true if the receiver knows how to handle the data on the pasteboard; otherwise, false.

Discussion

This method uses the NSImageRep class method imageUnfilteredPasteboardTypes() to find a class that can handle the data in the specified pasteboard. If you create your own NSImageRep subclasses, override the imageUnfilteredPasteboardTypes() method to notify NSImage of the pasteboard types your class supports.

See Also

Related Documentation

Determining Supported Types of Images