Fix the issue that AnimatedImage name and data initializer does not works

This commit is contained in:
DreamPiggy 2019-11-10 04:17:32 +08:00
parent 3ae64cfaf5
commit 996f65ea15
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
#else
let image = SDAnimatedImage(named: name, in: bundle, compatibleWith: nil)
#endif
self.image = image
_image = .init(wrappedValue: image)
}
/// Create an animated image with data and scale.
@ -139,7 +139,7 @@ public struct AnimatedImage : PlatformViewRepresentable {
public init(data: Data, scale: CGFloat = 0, isAnimating: Binding<Bool>) {
self._isAnimating = isAnimating
let image = SDAnimatedImage(data: data, scale: scale)
self.image = image
_image = .init(wrappedValue: image)
}
#if os(macOS)