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
{{ message }}
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
When you try to use same POPBasicAnimation on two CATextLayers and then you call pop_removeAllAnimations on both layers then first layer will still have animation and POPAnimator won't disable CADisplayLink. This results in using CPU without having animations.
In example:
// Somewhere in View:
POPBasicAnimation *opacityAnimation1 = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerOpacity];
opacityAnimation1.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];;
opacityAnimation1.toValue = @(!self.leftTimeLayer.hidden ? 1.0f : 0.0f);
opacityAnimation1.duration = [CMScrolloramaTableViewCell animationDuration:duration];
opacityAnimation1.removedOnCompletion = YES;
[opacityAnimation1 setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
if (self.leftTimeLayer.opacity < 0.1f) {
self.leftTimeLayer.hidden = YES;
}
if (self.rightTimeLayer.opacity < 0.1f) {
self.rightTimeLayer.hidden = YES;
}
}
}];
//And then in dealloc
[_leftTimeLayer pop_removeAllAnimations];
[_rightTimeLayer pop_removeAllAnimations];
//Inside POPAnimator.mm
static void updateDisplayLink(POPAnimator *self) {
BOOL paused = (0 == self->_observers.count && self->_list.empty()) || self->_disableDisplayLink;
// paused is always YES because _list isn't empty. It contains leftTimeLayer reference.
}
Workaround for this is to create 2 animations but that doubles the code and opens door for bugs.
I'm using version 1.0.9 from cocoapods
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When you try to use same POPBasicAnimation on two CATextLayers and then you call pop_removeAllAnimations on both layers then first layer will still have animation and POPAnimator won't disable CADisplayLink. This results in using CPU without having animations.
In example:
Workaround for this is to create 2 animations but that doubles the code and opens door for bugs.
I'm using version 1.0.9 from cocoapods
The text was updated successfully, but these errors were encountered: