File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -221,11 +221,6 @@ public struct AnimatedImage : PlatformViewRepresentable {
221
221
}
222
222
223
223
func updateView( _ view: AnimatedImageViewWrapper , context: Context ) {
224
- // macOS SDAnimatedImageView.animates should initialize to true in advance before set image
225
- #if os(macOS)
226
- view. wrapped. animates = true
227
- #endif
228
-
229
224
if let image = self . image {
230
225
#if os(watchOS)
231
226
view. wrapped. setImage ( image)
@@ -243,7 +238,9 @@ public struct AnimatedImage : PlatformViewRepresentable {
243
238
}
244
239
245
240
#if os(macOS)
246
- view. wrapped. animates = self . isAnimating
241
+ if self . isAnimating != view. wrapped. animates {
242
+ view. wrapped. animates = self . isAnimating
243
+ }
247
244
#else
248
245
if self . isAnimating != view. wrapped. isAnimating {
249
246
if self . isAnimating {
You can’t perform that action at this time.
0 commit comments