Open magavelis opened 8 years ago
Not supported currently.
You may set currentAnimatedImageIndex
manually, but it may costs lots of CPU if the image is compressed with dispose methods.
I add an observer for currentAnimatedImageIndex
,and when it reach the last frame,I change currentAnimatedImageIndex
.However,there happens a dead lock.Some code and the call stack are described as below.
code:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context {
if ([keyPath isEqualToString:NSStringFromSelector(@selector(currentAnimatedImageIndex))]) {
YYAnimatedImageView *imageView = object;
if (imageView.currentAnimatedImageIndex == lastFrameIndex) {
imageView.currentAnimatedImageIndex = secondFrameIndex;
}
}
}
call stack:
Any ideas?Am I using in a incorrect way?
How could I implement functionality to make YYAnimatedImageView to play animations in ping pong style? When animation reach a last frame it should continue animating till reach first frame using negative step. This should be continued till total loop count is reached.