Fix the compile issue of macOS

This commit is contained in:
DreamPiggy 2019-10-05 15:49:16 +08:00
parent 2587161069
commit b62cbdf072
1 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,12 @@ public struct AnimatedImage : PlatformViewRepresentable {
}
}
}
#if os(macOS)
if self.isAnimating != view.wrapped.animates {
view.wrapped.animates = self.isAnimating
}
#else
if self.isAnimating != view.wrapped.isAnimating {
if self.isAnimating {
view.wrapped.startAnimating()
@ -136,6 +142,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
view.wrapped.stopAnimating()
}
}
#endif
configureView(view, context: context)
layoutView(view, context: context)