Display the y value of a uiImageView during an animation
- by user1422132
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?