Swiftpack.co - nssina/NSAsyncCachedImage as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nssina.
nssina/NSAsyncCachedImage v1.1.0
Lightweight way to load and cache images asynchronously in SwiftUI views
⭐️ 8
🕓 4 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/nssina/NSAsyncCachedImage.git", from: "v1.1.0")

NSAsyncCachedImage

Swift Package Manager compatible

NSAsyncCachedImage is a lightweight package which provides the main thing that is missing from Apple AsyncImage API, Caching!. This package will let you download and cache images asynchronously in SwiftUI views.

Supported Platforms

NSAsyncCachedImage supports iOS 13, macOS 10.15, tvOS 13 and watchOS 6.

Installation

NSAsyncCachedImage can be installed with the Swift Package Manager:

https://github.com/nssina/NSAsyncCachedImage.git

Usage

import SwiftUI
import NSAsyncCachedImage

struct ContentView: View {
    var body: some View {
        VStack {
            NSAsyncCachedImage("https://example.com/icon.png") { image in
                image
                    .resizable()
            } placeHolder: {
                ProgressView()
            }
            .frame(width: 200, height: 200)
            .cornerRadius(12)
        }
        .padding()
    }
}

License

The project is available under MIT Licence

GitHub

link
Stars: 8
Last commit: 4 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v1.1.0
4 weeks ago

• Fix crash if image data was nil • More options for initializing • Add the ability to add modifiers after the image loaded • Performance improvements

Full Changelog: https://github.com/nssina/NSAsyncCachedImage/compare/v1.0.1...v1.1.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics