Reputation: 2253
I want current position of animating UIView during animation and I am using this code.
CABasicAnimation * m_pAnimationObj = [CABasicAnimation animationWithKeyPath:@"transform.translation"];
[m_pAnimationObj setFromValue:[NSValue valueWithCGPoint:CGPointMake(0,-50)]];
[m_pAnimationObj setToValue:[NSValue valueWithCGPoint:CGPointMake(0,[UIScreen mainScreen].bounds.size.height+100)]];
m_pAnimationObj.duration = 2.0;
m_pAnimationObj.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[DropImage.layer addAnimation:m_pAnimationObj forKey:@"animations"];
Please answer if anyone knows about this. Thank you in advance!
Upvotes: 0
Views: 792
Reputation: 4825
Use this code:
CGRect currentCenter = [drawingView.layer.presentationLayer center];
or
CGRect currentFrame = [DropImage.layer.presentationLayer frame];
Upvotes: 4