Skip to content

Commit b62cbdf

Browse files
committed
Fix the compile issue of macOS
1 parent 2587161 commit b62cbdf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,20 @@ public struct AnimatedImage : PlatformViewRepresentable {
129129
}
130130
}
131131
}
132+
133+
#if os(macOS)
134+
if self.isAnimating != view.wrapped.animates {
135+
view.wrapped.animates = self.isAnimating
136+
}
137+
#else
132138
if self.isAnimating != view.wrapped.isAnimating {
133139
if self.isAnimating {
134140
view.wrapped.startAnimating()
135141
} else {
136142
view.wrapped.stopAnimating()
137143
}
138144
}
145+
#endif
139146

140147
configureView(view, context: context)
141148
layoutView(view, context: context)

0 commit comments

Comments
 (0)