Display the y value of a uiImageView during an animation
Posted
by
user1422132
on Stack Overflow
See other posts from Stack Overflow
or by user1422132
Published on 2012-06-20T15:12:07Z
Indexed on
2012/06/20
15:16 UTC
Read the original article
Hit count: 166
I have the following code:
NSString *yValue;
yValue=[[NSString alloc] initWithFormat:@"%1.2f" , imageView.center.y];
CGRect labelFrame = CGRectMake( 10, 100, 200, 50 );
UILabel* label5 = [[UILabel alloc] initWithFrame: labelFrame];
[label5 setBackgroundColor:[UIColor blackColor]];
[label5 setText: yValue];
[label5 setTextColor: [UIColor orangeColor]];
[self.view addSubview: label5];
This correctly shows the y value of the UIimageView but the problem is that it only shows the ending y value.
When a person flicks the UIImageView I animate it using:
[UIView animateWithDuration:2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ recognizer.view.center = finalPoint; }
What I want is the label5 to display the y value of the imageView during the animation not just after. Is it possible to do this?
© Stack Overflow or respective owner