explaingit

kean/nuke

8,584SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Swift library that handles downloading, caching, and displaying images in iOS, macOS, and other Apple platform apps, replaces manual download and cache code with a few lines.

Mindmap

mindmap
  root((nuke))
    What it does
      Image loading
      Memory cache
      Disk cache
    Tech Stack
      Swift
      SwiftUI
      UIKit
    Features
      Progressive loading
      Prefetching
      Video clips
    Platforms
      iOS macOS
      tvOS watchOS
      visionOS
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Load and display remote images in a SwiftUI app using a single LazyImage view with one line of code

USE CASE 2

Cache downloaded images on disk so your iOS app loads faster on repeat visits

USE CASE 3

Prefetch images before a user scrolls to them to eliminate loading delays in lists

USE CASE 4

Show a low-quality image preview while the full version is still downloading

Tech stack

SwiftSwiftUIUIKitSwift Package Manager

Getting it running

Difficulty · easy Time to first run · 5min

Requires Swift 6.2 and Xcode 26, older versions are available if you need lower platform targets.

Use freely for any purpose including commercial apps, as long as you include the copyright notice.

In plain English

Nuke is a Swift library for loading and displaying images in Apple platform apps: iOS, macOS, tvOS, watchOS, and visionOS. When you build an app that shows images fetched from the internet, you need to handle downloading, caching, and displaying them efficiently. Nuke takes care of all of that so you do not have to write it yourself. The library stores images in two places: in memory for quick access while the app is running, and on disk so they load faster the next time the user opens the app. It can also prefetch images before the user scrolls to them, so the app feels more responsive. For images that support it, Nuke can show a low-quality preview while the full image is still downloading, which is called progressive loading. It supports common image formats including JPEG, WebP, GIF, and HEIF. Nuke ships as four separate modules you can mix and match. The core module handles the image loading pipeline. A UI module provides ready-made components for both SwiftUI and UIKit, including a LazyImage view that you drop into your SwiftUI layout with a single line of code. There is also an extensions module for UIKit's image views and a video module for short video clips. The README shows that the library compiles in under 2 seconds and has an automated test suite twice the size of the codebase itself. It has been in development since 2015. The current version requires Swift 6.2 and Xcode 26, targeting iOS 15 and equivalent releases on other Apple platforms. Older versions with lower requirements are also available. Installation is done through Swift Package Manager. Nuke is released under the MIT license.

Copy-paste prompts

Prompt 1
I'm building a SwiftUI app and need to load images from a URL. Show me how to use Nuke's LazyImage view, set a placeholder, and configure disk caching.
Prompt 2
Help me set up Nuke in a UIKit iOS app with a UITableView so images prefetch before the user scrolls to each row.
Prompt 3
I want to display animated GIFs in my iOS app using Nuke. Walk me through adding the right module and the code to render them in a SwiftUI view.
Prompt 4
Show me how to add the Nuke Swift package in Xcode via Swift Package Manager and display a remote image with a loading spinner placeholder.
Open on GitHub → Explain another repo

← kean on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.