Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nssina/nsasynccachedimage
Lightweight way to load and cache images asynchronously in SwiftUI views
https://github.com/nssina/nsasynccachedimage
cache image image-processor ios macos swift swiftpm swiftui tvos watchos xcode
Last synced: 29 days ago
JSON representation
Lightweight way to load and cache images asynchronously in SwiftUI views
- Host: GitHub
- URL: https://github.com/nssina/nsasynccachedimage
- Owner: nssina
- License: mit
- Created: 2022-11-01T19:45:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T16:27:07.000Z (over 1 year ago)
- Last Synced: 2024-03-14T16:45:03.427Z (9 months ago)
- Topics: cache, image, image-processor, ios, macos, swift, swiftpm, swiftui, tvos, watchos, xcode
- Language: Swift
- Homepage:
- Size: 33.2 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NSAsyncCachedImage
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-success.svg)](https://github.com/apple/swift-package-manager)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnssina%2FNSAsyncCachedImage%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/nssina/NSAsyncCachedImage)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnssina%2FNSAsyncCachedImage%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/nssina/NSAsyncCachedImage)NSAsyncCachedImage is a lightweight package which provides the main thing that is missing from Apple [AsyncImage](https://developer.apple.com/documentation/swiftui/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://www.swift.org/package-manager/):
```
https://github.com/nssina/NSAsyncCachedImage.git
```## Usage
```swift
import SwiftUI
import NSAsyncCachedImagestruct 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](./LICENSE)