Nuke Documentation

Protocol Image​Decoding

public protocol ImageDecoding  

An image decoder.

A decoder is a one-shot object created for a single image decoding session.

ImageDecoding ImageDecoding ImageDecoderRegistering ImageDecoderRegistering ImageDecoderRegistering->ImageDecoding ImageDecoders.Empty ImageDecoders.Empty ImageDecoders.Empty->ImageDecoding ImageDecoders.Default ImageDecoders.Default ImageDecoders.Default->ImageDecoding

Types Conforming to Image​Decoding

ImageDecoders.Default

A decoder that supports all of the formats natively supported by the system.

ImageDecoders.Empty

A decoder that returns an empty placeholder image and attaches image data to the image container.

ImageDecoderRegistering

An image decoder which supports automatically registering in the decoder register.

Default Implementations

is​Asynchronous

public var isAsynchronous: Bool  

Returns true by default.

decode​Partially​Downloaded​Data(_:​)

public func decodePartiallyDownloadedData(_ data: Data) -> ImageContainer?  

The default implementation which simply returns nil (no progressive decoding available).

Requirements

is​Asynchronous

var isAsynchronous: Bool  

Return true if you want the decoding to be performed on the decoding queue (see imageDecodingQueue). If false, the decoding will be performed synchronously on the pipeline operation queue. By default, true.

decode(_:​)

func decode(_ data: Data) -> ImageContainer? 

Produces an image from the given image data.

decode​Partially​Downloaded​Data(_:​)

func decodePartiallyDownloadedData(_ data: Data) -> ImageContainer? 

Produces an image from the given partially dowloaded image data. This method might be called multiple times during a single decoding session. When the image download is complete, decode(data:) method is called.

Returns

nil by default.