init(draw:delegate:)
Returns a representation of an image initialized with the specified delegate information.
Declaration
init(draw selector: Selector, delegate: Any)Parameters
- selector:
The selector to call when it is time to draw the image. The method should take a single parameter of type
idthat represents the Nscustomimagerep object that initiated drawing. The method must draw the image starting at the point (0, 0) in the current coordinate system. - delegate:
The delegate object that responds to the selector in
aMethod.
Return Value
An initialized NSCustomImageRep object, or nil if the object could not be initialized.
Discussion
When the receiver is asked to draw the image, it sends the specified message to the selector, passing itself as a parameter to the delegate method. The delegate’s drawing method should have the following form:
- (void)myCustomDrawMethod:(id)anNSCustomImageRep;