Skip to content

An image loading and caching framework for SwiftUI using Combine.

License

Notifications You must be signed in to change notification settings

d-date/ImagePipelineCombine

Repository files navigation

MIT License

ImagePipelineCombine

An image loading and caching framework for SwiftUI using Combine.

This framework respects ImagePipeline, but cutting off image process feature.

Usage

For SwiftUI

By using RemoteImage confirming to SwiftUI.View, fetch image with URL and cache on memory.

var body: some View {
  RemoteImage(url: url, defaultImage: defaultImage)
}

Using Publisher

  let pipeline = ImagePipeline()
  pipeline.load(url)
    .sink { (completion) in

    } receiveValue: { (image) in
    
    }
  }
  .store(in: &cancellables)  

Supported content types

✅ PNG
✅ JPEG
✅ GIF
✅ WebP

Supported platforms

  • macOS v10.15 and later
  • iOS v13.0 and later
  • tvOS v13.0 and later

Note: watchOS is not supported now since SnapshotTesting is not supported for watchOS.

Work in progress

  • Disk Caching
  • Image Processing

Installation

Only support via Swift package manager installation.

Swift Package Manager

dependencies: [
  .package(url: "https://github.com/d-date/ImagePipelineCombine.git", from: "0.1.0")
]

About

An image loading and caching framework for SwiftUI using Combine.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages