File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ public struct AnimatedImage : PlatformViewRepresentable {
211
211
}
212
212
213
213
func updateView( _ view: AnimatedImageViewWrapper , context: PlatformViewRepresentableContext < AnimatedImage > ) {
214
+ // macOS SDAnimatedImageView.animates should initialize to true in advance before set image
215
+ #if os(macOS)
216
+ view. wrapped. animates = true
217
+ #endif
218
+
214
219
if let image = imageModel. image {
215
220
#if os(watchOS)
216
221
view. wrapped. setImage ( image)
@@ -228,9 +233,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
228
233
}
229
234
230
235
#if os(macOS)
231
- if self . isAnimating != view. wrapped. animates {
232
- view. wrapped. animates = self . isAnimating
233
- }
236
+ view. wrapped. animates = self . isAnimating
234
237
#else
235
238
if self . isAnimating != view. wrapped. isAnimating {
236
239
if self . isAnimating {
You can’t perform that action at this time.
0 commit comments