Instance Method


Tells the delegate that an incrementally loaded image has been loaded and decompressed as completely as is possible.


optional func image(_ image: NSImage, didLoadRepresentation rep: NSImageRep, with status: NSImage.LoadStatus)



The image object whose contents are being loaded.


The image representation object that loaded the image data.


The status of the load operation. For a list of possible values, see NSImage.LoadStatus in NSImage.


The delegate must implement this method if it wants to support the incremental loading of images. In that case, you must also set up the image object to be loaded lazily, by initializing it using the init(byReferencingFile:) or init(byReferencing:) method.

If an error occurs during downloading or decompression, the status parameter is set to NSImageLoadStatusInvalidData, NSImageLoadStatusUnexpectedEOF, or NSImageLoadStatusReadError. If the download was cancelled, the status parameter is set to NSImageLoadStatusCancelled.

See Also

Managing Incremental Loads

func image(NSImage, didLoadPartOfRepresentation: NSImageRep, withValidRows: Int)

Tells the delegate that part of the incrementally loaded image data is available.

func image(NSImage, didLoadRepresentationHeader: NSImageRep)

Tells the delegate that enough data has been read to determine the size of the image.

func image(NSImage, willLoadRepresentation: NSImageRep)

Tells the delegate that the image object is about to access its underlying bitmap data.

enum NSImage.LoadStatus

Status values for incremental image loading.