Nuke Documentation

Structure Image​Request.​User​Info​Key

public struct UserInfoKey: Hashable, ExpressibleByStringLiteral  

A key use in userInfo.

ImageRequest.UserInfoKey ImageRequest.UserInfoKey ExpressibleByStringLiteral ExpressibleByStringLiteral ImageRequest.UserInfoKey->ExpressibleByStringLiteral Hashable Hashable ImageRequest.UserInfoKey->Hashable

Member Of

ImageRequest

Represents an image request.

Conforms To

ExpressibleByStringLiteral
Hashable

Initializers

init(_:​)

public init(_ rawValue: String)  

init(string​Literal:​)

public init(stringLiteral value: String)  

Properties

raw​Value

public let rawValue: String

image​IdKey

public static let imageIdKey: ImageRequest.UserInfoKey = "github.com/kean/nuke/imageId"

By default, a pipeline uses URLs as unique image identifiers for caching and task coalescing. You can override this behavior by providing an imageIdKey instead. For example, you can use it to remove transient query parameters from the request.

let request = ImageRequest(
    url: URL(string: "http://example.com/image.jpeg?token=123"),
    userInfo: [.imageIdKey: "http://example.com/image.jpeg"]
)

scale​Key

public static let scaleKey: ImageRequest.UserInfoKey = "github.com/kean/nuke/scale"

The image scale to be used. By default, the scale matches the scale of the current display.

thumbnail​Key

public static let thumbnailKey: ImageRequest.UserInfoKey = "github.com/kean/nuke/thumbmnailKey"

Specifies whether the pipeline should retreive or generate a thumbnail instead of a full image. The thumbnail creation is generally significantly more efficient, especially in terms of memory usage, than image resizing (ImageProcessors.Resize).