SwiftUI Image loading and Animation framework powered by SDWebImage
Go to file
DreamPiggy 248515a2d6 Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
Example update the public API for AnimatedImage 2019-08-09 15:10:30 +08:00
SDWebImageSwiftUI Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
SDWebImageSwiftUI.xcodeproj Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
.gitignore Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
.travis.yml Initial commit 2019-08-07 18:10:05 +08:00
Cartfile Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
Cartfile.resolved Add the Xcode project to support Carthage. Fix the build issue on macOS/tvOS/watchOS 2019-08-09 15:58:21 +08:00
LICENSE Initial commit 2019-08-07 18:10:05 +08:00
README.md Add source files and CocoaPods integration for SwiftUI 2019-08-07 18:51:28 +08:00
SDWebImageSwiftUI.podspec Add source files and CocoaPods integration for SwiftUI 2019-08-07 18:51:28 +08:00
_Pods.xcodeproj Initial commit 2019-08-07 18:10:05 +08:00

README.md

SDWebImageSwiftUI

CI Status Version License Platform

What's for

This is an experimental project for SDWebImage.

It aims to ensure the following function available for users and try to do some experiences for Swift platform.

  • Swift Package Manager integration
  • SwiftUI compatibility
  • Swift source code compatibility

Requirements

  • Xcode 11+
  • iOS 13+
  • macOS 10.15+
  • tvOS 13+
  • watchOS 6+

Installation

SDWebImageSwiftUI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SDWebImageSwiftUI'

Usage

  • Using WebImage to load network image

It supports the placeholder and detail options control for image loading as SDWebImage.

var body: some View {
    WebImage(url: URL(string: "https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic")!)
        .scaledToFit()
        .frame(width: 300, height: 300, alignment: .center)
}
  • Using AnimatedImage to play animation
var body: some View {
    AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif")!)
}

It supports both image url or image data for animated image format.

Demo

To run the example using SwiftUI, following the steps:

cd Example
pod install

Then open the Xcode Workspace to run the demo application.

Screenshot

Author

DreamPiggy

License

SDWebImageSwiftUI is available under the MIT license. See the LICENSE file for more info.