This is more of a question than issue. Is there a way in lottie to get continuous animationProgress. I am aware that we can use UIKit addObserver but it doesn't seem to be working. Any other way?
@RishabhTayal You can use a CADisplayLink to get the animation's progress when the screen is updated.
- (void)animationObserver {
CADisplayLink *displayLink =[CADisplayLink displayLinkWithTarget:self
selector:@selector(animationProgress)];
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
[self.lottieAnimation playWithCompletion:^(BOOL animationFinished) {
[displayLink invalidate];
}];
}
- (void)animationProgress {
NSLog(@"Progress %f", self.lottieAnimation.animationProgress);
}
Most helpful comment
@RishabhTayal You can use a CADisplayLink to get the animation's progress when the screen is updated.