Preserve Ripple effect over UIImageView

試著忘記壹切 提交于 2019-12-03 09:15:32

I got my solution,

used this code

CFTimeInterval pausedTime = [imgRipple.layer convertTime:CACurrentMediaTime() fromLayer:nil];
     imgRipple.layer.speed = 0.0;
     imgRipple.layer.timeOffset = pausedTime;

and it paused

I'm not sure if it gives you what you want, but you can stop animations using those:

#import <QuartzCore/QuartzCore.h>

[CATransaction begin];
[myView.layer removeAllAnimations];
[CATransaction commit];

You can get the current state before stopping animation using presentationLayer:

CALayer* myPreLayer = [myView.layer presentationLayer];
CATransform3D currentTransform = [myPreLayer transform];
//if you need some specific info, you can use key-value pairs
float currentAngle = [[myPreLayer valueForKeyPath:@"transform.rotation.z"] floatValue];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!