Various fixes

This commit is contained in:
Ilya Laktyushin
2023-04-13 20:40:29 +04:00
parent bd782b0402
commit 4d51f5fcb3
8 changed files with 135 additions and 26 deletions

View File

@@ -117,6 +117,12 @@ public final class AnimationNode: ASDisplayNode {
self.animationView()?.currentProgress = progress
}
public func animate(from: CGFloat, to: CGFloat, completion: @escaping () -> Void) {
self.animationView()?.play(fromProgress: from, toProgress: to, completion: { _ in
completion()
})
}
public func setAnimation(name: String, colors: [String: UIColor]? = nil) {
self.currentParams = (name, colors)
if let url = getAppBundle().url(forResource: name, withExtension: "json"), let animation = Animation.filepath(url.path) {