Swiftpack.co - Package - kean/ImageTaskBuilder

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

kean/ImageTaskBuilder

A fun and convenient way to use Nuke

ImageTaskBuilder

A fun and convenient way to use Nuke.

See API Reference for a complete list of available options.

Usage

Downloading an image and applying processors.

ImagePipeline.shared.image(with: URL(string: "https://")!)
    .resize(width: 320)
    .blur(radius: 10)
    .priority(.high)
    .load { result in
        print(result)
    }
    
// Returns a discardable `ImageTask`.

You can take the same image that you described previously and automatically display in a view.

let image = ImagePipeline.shared.image(with: URL(string: "https://")!)
    .resize(width: 320)
    .blur(radius: 10)
    .priority(.high)
    
let imageView: UIImageView

image.display(in: imageView)
    .transition(.fadeIn(duration: 0.33))
    .placeholder(UIImage.placeholder)
    .contentMode(.center, for: .placeholder)
    .load()

When you call display(in:) method you get access to a variety of new options specific to the image view.

Requirements

Nuke Swift Xcode Platforms
Nuke 8.0 Swift 5.0 Xcode 10.2 iOS 10.0 / watchOS 3.0 / macOS 10.12 / tvOS 10.0

License

ImageTaskBuilder is available under the MIT license. See the LICENSE file for more info.

Github

link
Stars: 10
Last commit: 13 weeks ago

Dependencies

Releases

ImageTaskBuilder 0.7.0 - 2020-11-21T17:58:23

  • Fix deprecation warnings