Nuke Documentation

Structure Image​Loading​Options

public struct ImageLoadingOptions  

A set of options that control how the image is loaded and displayed.

Nested Types

ImageLoadingOptions.ContentModes

Custom content modes to be used for each image type (placeholder, success, failure).

ImageLoadingOptions.TintColors

Custom tint color to be used for each image type (placeholder, success, failure).

ImageLoadingOptions.Transition

An animated image transition.

Initializers

init(placeholder:​transition:​failure​Image:​failure​Image​Transition:​content​Modes:​tint​Colors:​)

public init(placeholder: UIImage? = nil, transition: Transition? = nil, failureImage: UIImage? = nil, failureImageTransition: Transition? = nil, contentModes: ContentModes? = nil, tintColors: TintColors? = nil)  
  • parameter placeholder: Placeholder to be displayed when the image is loading . nil by default.
  • parameter transition: The image transition animation performed when displaying a loaded image. Only runs when the image was not found in memory cache. nil by default (no animations).
  • parameter failureImage: Image to be displayd when request fails. nil by default.
  • parameter failureImageTransition: The image transition animation performed when displaying a failure image. nil by default.
  • parameter contentModes: Content modes to be used for each image type (placeholder, success, failure). nil by default (don't change content mode).

init(placeholder:​transition:​failure​Image:​failure​Image​Transition:​)

public init(placeholder: NSImage? = nil, transition: Transition? = nil, failureImage: NSImage? = nil, failureImageTransition: Transition? = nil)  

init(placeholder:​failure​Image:​)

public init(placeholder: UIImage? = nil, failureImage: UIImage? = nil)  

init()

public init()  

Properties

shared

public static var shared  

Shared options.

placeholder

public var placeholder: PlatformImage? 

Placeholder to be displayed when the image is loading. nil by default.

failure​Image

public var failureImage: PlatformImage? 

Image to be displayed when the request fails. nil by default.

transition

public var transition: Transition? 

The image transition animation performed when displaying a loaded image. Only runs when the image was not found in memory cache. nil by default.

failure​Image​Transition

public var failureImageTransition: Transition? 

The image transition animation performed when displaying a failure image. nil by default.

always​Transition

public var alwaysTransition = false

If true, the requested image will always appear with transition, even when loaded from cache.

is​Prepare​For​Reuse​Enabled

public var isPrepareForReuseEnabled = true

If true, every time you request a new image for a view, the view will be automatically prepared for reuse: image will be set to nil, and animations will be removed. true by default.

is​Progressive​Rendering​Enabled

public var isProgressiveRenderingEnabled = true

If true, every progressively generated preview produced by the pipeline is going to be displayed. true by default.

pipeline

public var pipeline: ImagePipeline? 

Custom pipeline to be used. nil by default.

processors

public var processors: [ImageProcessing]? 

The default processors to be applied to the images. nil by default.

content​Modes

public var contentModes: ContentModes? 

Content modes to be used for each image type (placeholder, success, failure). nil by default (don't change content mode).

tint​Colors

public var tintColors: TintColors? 

Tint colors to be used for each image type (placeholder, success, failure). nil by default (don't change tint color or rendering mode).