目录
目录README.md

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

关于
58.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号