Back to Nuke

Image Loading System

README.md

13.0.55.2 KB
Original Source

Image Loading System

<p align="left"> </p>

Serving Images Since 2015

Load images from different sources and display them in your app using simple and flexible APIs. Take advantage of the powerful image processing capabilities and a robust caching system.

The framework is lean and compiles in under 2 seconds¹. It has an automated test suite 2x the codebase size, ensuring excellent reliability. Nuke is optimized for performance, and its advanced architecture enables virtually unlimited possibilities for customization.

Memory and Disk Cache · Image Processing & Decompression · Request Coalescing & Priority · Prefetching · Resumable Downloads · Progressive JPEG · HEIF, WebP, GIF · SwiftUI · Async/Await

Sponsors

<table> <tr> <td valign="center" align="center"> <a href="https://proxyman.io">
      <p>Proxyman</p>
    </a>
</td>
</tr> </table>

Documentation

Load images using ImagePipeline from the lean core Nuke module:

swift
func loadImage() async throws {
    let imageTask = ImagePipeline.shared.imageTask(with: url)
    for await progress in imageTask.progress {
        // Update progress
    }
    imageView.image = try await imageTask.image
}

Or use the built-in UI components from NukeUI:

swift
struct ContentView: View {
    var body: some View {
        LazyImage(url: URL(string: "https://example.com/image.jpeg"))
    }
}

The Getting Started guide is the best place to start. Check out Nuke Demo for more examples.

<a href="https://kean-docs.github.io/nuke/documentation/nuke/getting-started"> </a>

Installation

Nuke supports Swift Package Manager, which is the recommended option. If that doesn't work for you, you can use binary frameworks attached to the releases.

The package ships with four modules that you can install depending on your needs:

ModuleDescription
NukeThe lean core framework with ImagePipeline, ImageRequest, and more
NukeUIThe UI components: LazyImage (SwiftUI) and ImageView (UIKit, AppKit)
NukeExtensionsThe extensions for UIImageView (UIKit, AppKit)
NukeVideoThe components for decoding and playing short videos

Extensions

The image pipeline is easy to customize and extend. Check out the following first-class extensions and packages built by the community.

NameDescription
Alamofire PluginReplace networking layer with Alamofire
NukeWebPCommunity. WebP support, built by Maxim Kolesnik
WebP PluginCommunity. WebP support, built by Ryo Kosuge
AVIF PluginCommunity. AVIF support, built by Denis
RxNukeRxSwift extensions for Nuke with examples

Looking for a way to log your network requests, including image requests? Check out Pulse.

Minimum Requirements

Upgrading from the previous version? Use a Migration Guide.

NukeSwiftXcodePlatforms
Nuke 13.0Swift 6.2Xcode 26.0iOS 15.0, watchOS 8.0, macOS 12.0, tvOS 13.0, visionOS 1.0
Nuke 12.0Swift 5.7Xcode 15.0iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0

License

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


<a name="footnote-1">¹</a> Measured on MacBook Pro 14" 2021 (10-core M1 Pro)