Nuke Documentation

Structure Image​Container

public struct ImageContainer  

An image container with an image and associated metadata.

Nested Types

ImageContainer.UserInfoKey

A key use in userInfo.

Initializers

init(image:​type:​is​Preview:​data:​user​Info:​)

public init(image: PlatformImage, type: ImageType? = nil, isPreview: Bool = false, data: Data? = nil, userInfo: [UserInfoKey: Any] = [:])  

Initializes the container with the given image.

Properties

image

public var image: NSImage

A fetched image.

image

public var image: UIImage

A fetched image.

type

public var type: ImageType? 

An image type.

is​Preview

public var isPreview: Bool

Returns true if the image in the container is a preview of the image.

data

public var data: Data? 

Contains the original image data, but only if the decoder decides to attach it to the image.

The default decoder (ImageDecoders.Default) attaches data to GIFs to allow to display them using a rendering engine of your choice.

user​Info

public var userInfo: [UserInfoKey: Any] 

An metadata provided by the user.

Methods

map(_:​)

public func map(_ closure: (PlatformImage) -> PlatformImage?) -> ImageContainer?  

Modifies the wrapped image and keeps all of the rest of the metadata.