diff --git a/Example/SDWebImageSwiftUIDemo/ContentView.swift b/Example/SDWebImageSwiftUIDemo/ContentView.swift index 04f1c193..9d318dc9 100644 --- a/Example/SDWebImageSwiftUIDemo/ContentView.swift +++ b/Example/SDWebImageSwiftUIDemo/ContentView.swift @@ -31,6 +31,7 @@ struct ContentView: View { "https://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic", "https://www.sample-videos.com/img/Sample-png-image-1mb.png", "https://nr-platform.s3.amazonaws.com/uploads/platform/published_extension/branding_icon/275/AmazonS3.png", + "https://raw.githubusercontent.com/ibireme/YYImage/master/Demo/YYImageDemo/mew_baseline.jpg", "http://via.placeholder.com/200x200.jpg"] @State var animated: Bool = false // You can change between WebImage/AnimatedImage diff --git a/README.md b/README.md index 3a2b6315..b0e956e1 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ let package = Package( ### Using `WebImage` to load network image - [x] Supports placeholder and detail options control for image loading as SDWebImage -- [x] Supports progressive image loading +- [x] Supports progressive image loading (like baseline) - [x] Supports success/failure/progress changes event for custom handling - [x] Supports indicator with activity/progress indicator and customization - [x] Supports built-in animation and transition, powered by SwiftUI @@ -108,17 +108,17 @@ Note: This `WebImage` using `Image` for internal implementation, which is the be ### Using `AnimatedImage` to play animation - [x] Supports network image as well as local data and bundle image -- [x] Supports animated progressive image loading +- [x] Supports animated progressive image loading (like web browser) - [x] Supports animation control using the SwiftUI Binding - [x] Supports indicator and transition, powered by SDWebImage and Core Animation -- [x] Supports advanced control like loop count, incremental load, buffer size +- [x] Supports advanced control like loop count, playback rate, buffer size, runloop mode, etc - [x] Supports coordinate with native UIKit/AppKit/WatchKit view ```swift var body: some View { Group { // Network - AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif")) + AnimatedImage(url: URL(string: "https://raw.githubusercontent.com/liyong03/YLGIFImage/master/YLGIFImageDemo/YLGIFImageDemo/joy.gif"), options: [.progressiveLoad]) // Progressive Load .onFailure { error in // Error } diff --git a/SDWebImageSwiftUI/Classes/WebImage.swift b/SDWebImageSwiftUI/Classes/WebImage.swift index ee9c42ce..1111bc29 100644 --- a/SDWebImageSwiftUI/Classes/WebImage.swift +++ b/SDWebImageSwiftUI/Classes/WebImage.swift @@ -10,8 +10,6 @@ import SwiftUI import SDWebImage public struct WebImage : View { - static var emptyImage = PlatformImage() - var url: URL? var options: SDWebImageOptions var context: [SDWebImageContextOption : Any]? @@ -49,7 +47,7 @@ public struct WebImage : View { if placeholder != nil { placeholder } else { - Image(platformImage: WebImage.emptyImage) + EmptyView() } } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) diff --git a/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h b/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h index 4fc701b2..ca45772d 100644 --- a/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h +++ b/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h @@ -7,8 +7,6 @@ */ #import -#import -#import //! Project version number for SDWebImageSwiftUI. FOUNDATION_EXPORT double SDWebImageSwiftUIVersionNumber; @@ -17,5 +15,5 @@ FOUNDATION_EXPORT double SDWebImageSwiftUIVersionNumber; FOUNDATION_EXPORT const unsigned char SDWebImageSwiftUIVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - +#import +#import