An NSCustom​Image​Rep object uses a delegate object to render an image. When called upon to produce an image, it 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 NSImage​Rep directly.


Initializing a New NSCustomImageRep

init(draw:​ Selector, delegate:​ Any)

Returns an NSCustom​Image​Rep object initialized with the specified delegate information.

init(size:​ NSSize, flipped:​ Bool, drawing​Handler:​ (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 drawing​Handler:​ ((NSRect) -> Bool)?

The destination rectangle of the drawing handler Block.

Identifying the Object

var delegate:​ Any​Object?

the delegate object that renders the image for the receiver.

var draw​Selector:​ Selector?

The selector for the delegate's drawing method.


Inherits From