An object that uses a delegate object to render an image from a custom format.


class NSCustomImageRep : NSImageRep


When called upon to produce an image, an NSCustomImageRep sends a message to its delegate to do the actual drawing. You can use this class to support custom image formats without going to the trouble of subclassing NSImageRep directly.


Initializing a New NSCustomImageRep

init(draw: Selector, delegate: Any)

Returns an NSCustomImageRep object initialized with the specified delegate information.

init(size: NSSize, flipped: Bool, drawingHandler: (NSRect) -> Bool)

Initializes an image representation of the specified size and flipped status, using a Block to draw its content.

Getting the Custom Image Drawing Handler Destination Rectangle

var drawingHandler: ((NSRect) -> Bool)?

The destination rectangle of the drawing handler Block.

Identifying the Object

var delegate: AnyObject?

the delegate object that renders the image for the receiver.

var drawSelector: Selector?

The selector for the delegate's drawing method.


Inherits From

Conforms To