You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Change the placeholder into Web URL init method (placeholder not works for data/bundle init method)
2. Add convenient .progress/.activity syntax for AnimatedImage indicator
.scaledToFit() // Attention to call it on AnimatedImage, but not `some View` after View Modifier (Swift Protocol Extension method is static dispatched)
211
204
205
+
// Supports SwiftUI ViewBuilder placeholder as well
@@ -90,12 +96,6 @@ final class AnimatedImageConfiguration: ObservableObject {
90
96
// These configurations only useful for web image loading
91
97
varindicator:SDWebImageIndicator?
92
98
vartransition:SDWebImageTransition?
93
-
varplaceholder:PlatformImage?
94
-
varplaceholderView:PlatformView?{
95
-
didSet {
96
-
oldValue?.removeFromSuperview()
97
-
}
98
-
}
99
99
}
100
100
101
101
/// A Image View type to load image from url, data or bundle. Supports animated and static image format.
@@ -115,13 +115,19 @@ public struct AnimatedImage : PlatformViewRepresentable {
115
115
/// True to start animation, false to stop animation.
116
116
@BindingpublicvarisAnimating:Bool
117
117
118
-
/// Create an animated image with url, placeholder, custom options and context.
118
+
/// Create an animated image with url, placeholder, custom options and context, including animation control binding.
119
119
/// - Parameter url: The image url
120
120
/// - Parameter placeholder: The placeholder image to show during loading
121
121
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
122
122
/// - Parameter context: A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
/// Create an animated image with url, placeholder, custom options and context, including animation control binding.
@@ -130,46 +136,37 @@ public struct AnimatedImage : PlatformViewRepresentable {
130
136
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
131
137
/// - Parameter context: A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
132
138
/// - Parameter isAnimating: The binding for animation control
/// Associate a placeholder when loading image with url
788
-
/// - Parameter content: A view that describes the placeholder.
789
-
/// - note: The differences between this and placeholder image, it's that placeholder image replace the image for image view, but this modify the View Hierarchy to overlay the placeholder hosting view
790
-
publicfunc placeholder<T>(@ViewBuilder content:()->T)->AnimatedImagewhere T :View{
0 commit comments