Closed tiepvuvan closed 4 years ago
Sounds reasonable. The only way to resolve this, it's to drop the WatchKit animation support :(
I'm working on #43 and replace this implementation.
The old WatchKit is suck on the animation, which Apple itself use UIKit
method to build the system App, but you can not and have to suck at Storyboard (which disable the dynamic create of View). Nobody can implement the animated image using WatchKit, without private API.
SwiftUI is the actually only public Native UI framework for watchOS.
@tiepvuvan It's done.
Now, from v0.9.0, if you really want to use Animated Image on watchOS, you should use WebImage
instead, with the new public func animated(_ animated: Bool = true) -> WebImage
API
WebImage(url: URL(string:url))
.resizable()
.animated()
.animation(.easeInOut(duration: 0.5))
.transition(.fade)
.scaledToFit()
It's a SwiftUI view (not UIViewRepresentable), without any hack. But currently, because of SwiftUI's layout system and rendering system, the performance may be a little slower than the SDAnimatedImageView
(our current AnimatedImage UIView implementation).
But this is the best compatible components for SwiftUI. Which use all the SwiftUI lifecycle. After I release the new version, you can have a try with that.
@tiepvuvan Use v0.9.0 and new WebImage
instead.
We're trying to upload binary to AppStoreConnect, but we got this error, seem like we should remove the private API of AnimatedImage