You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you try using the "pausable" modifier ? I think if the gif play ended with last frame is normal behavior
Actually, this internal UIKit view(SDAnimatedImageView) has API to seek to any frame index if you want.
You can grab the native UIKit view via "onViewCreate" API and call the API. For example, you can even observe the player status using KVO
AnimatedImage(url: xxx).onViewCreate{ view in
if let player = view.player {lettoken=self.observe(value: player, forKeyPath: \.currentFrameIndex){ changes
letcurrentFrameIndex=changes[.newValue]
if (currentFrameIndex +1== player.totalFrameCount){// last frame
player.stopAnimating()}}}}
Hello there,
What is the best way to reset the gif to zero frame after completing playing it? here is the code I have so far:
AnimatedImage(url: URL(string: selectedArticle.imageName), placeholderImage: .init(systemName: "Pic 7"))
.customLoopCount(1)
.runLoopMode(.common)
.transition(.fade)
The text was updated successfully, but these errors were encountered: