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
@@ -80,8 +80,8 @@ public struct AnimatedImage : PlatformViewRepresentable {
80
80
/// - Parameter placeholder: The placeholder image to show during loading
81
81
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
82
82
/// - 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.
@@ -90,9 +90,8 @@ public struct AnimatedImage : PlatformViewRepresentable {
90
90
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
91
91
/// - 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.
92
92
/// - Parameter isAnimating: The binding for animation control
// on watchOS, there are no workaround like `AnimatedImageViewWrapper` to override `intrinsicContentSize`, so the aspect ratio is undetermined and cause sizing issues
529
-
// To workaround, we do not call default implementation for this case, using original solution instead
// on watchOS, there are no workaround like `AnimatedImageViewWrapper` to override `intrinsicContentSize`, so the aspect ratio is undetermined and cause sizing issues
529
+
// To workaround, we do not call default implementation for this case, using original solution instead
530
+
self
531
+
}
531
532
}
532
533
#endif
533
534
}
@@ -650,10 +651,17 @@ extension AnimatedImage {
650
651
}
651
652
}
652
653
653
-
#if os(macOS) || os(iOS) || os(tvOS)
654
654
// Web Image convenience
655
655
extensionAnimatedImage{
656
656
657
+
/// Associate a placeholder when loading image with url
658
+
/// - Parameter content: A view that describes the placeholder.
Copy file name to clipboardExpand all lines: SDWebImageSwiftUI/Classes/Indicator/Indicator.swift
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,15 @@ import SwiftUI
11
11
12
12
/// A type to build the indicator
13
13
publicstructIndicator<T>where T :View{
14
-
varbuilder:(Binding<Bool>,Binding<CGFloat>)->T
14
+
varcontent:(Binding<Bool>,Binding<CGFloat>)->T
15
15
16
16
/// Create a indicator with builder
17
17
/// - Parameter builder: A builder to build indicator
18
18
/// - Parameter isAnimating: A Binding to control the animation. If image is during loading, the value is true, else (like start loading) the value is false.
19
19
/// - Parameter progress: A Binding to control the progress during loading. If no progress can be reported, the value is 0.
20
20
/// Associate a indicator when loading image with url
Copy file name to clipboardExpand all lines: SDWebImageSwiftUI/Classes/WebImage.swift
+61-29Lines changed: 61 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -13,22 +13,23 @@ public struct WebImage : View {
13
13
staticvaremptyImage=PlatformImage()
14
14
15
15
varurl:URL?
16
-
varplaceholder:Image?
17
16
varoptions:SDWebImageOptions
18
17
varcontext:[SDWebImageContextOption:Any]?
19
18
20
19
varconfigurations:[(Image)->Image]=[]
21
20
21
+
varplaceholder:AnyView?
22
+
varretryOnAppear:Bool=true
23
+
varcancelOnDisappear:Bool=true
24
+
22
25
@ObservedObjectvarimageManager:ImageManager
23
26
24
27
/// Create a web image with url, placeholder, custom options and context.
25
28
/// - Parameter url: The image url
26
-
/// - Parameter placeholder: The placeholder image to show during loading
27
29
/// - Parameter options: The options to use when downloading the image. See `SDWebImageOptions` for the possible values.
28
30
/// - 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.
0 commit comments