I have an UIImageview which moves from a position to another. When I try to tap on the image during the animation touch event delegate method is not called. But when I tap on image after the completion of the animation, the delegate method executes. How can I detect the touch event on the uiimageview while it is changing its position.
my code:
vwb2 = [[UIView alloc] initWithFrame:CGRectMake(240, 500, 50, 50)];
[self.view addSubview:vwb2];
ballon2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"b2.png"]];
ballon2.userInteractionEnabled = TRUE;
ballon2.frame = CGRectMake(0, 0, 50, 50);
[vwb2 addSubview:ballon2];
[ballon2 release];
Edit:
My code for animation:
[UIView animateWithDuration:2.0
animations:^{
vwb1.center = CGPointMake(260, 40);
}
completion:^(BOOL finished){
[UIView animateWithDuration:1.5
animations:^{
vwb2.center = CGPointMake(260, 100);
}
completion:^(BOOL finished){
[UIView animateWithDuration:1.0
animations:^{
vwb3.center = CGPointMake(260, 160);
}
completion:^(BOOL finished){
[UIView animateWithDuration:1.0
animations:^{
vwb4.center = CGPointMake(260, 220);
}
completion:^(BOOL finished){
[UIView animateWithDuration:1.0 animations:^{
vwb5.center = CGPointMake(260, 280);
} ];
}];
}];
}
];
}];
Thanks
Pankaj
I have posted correct solution as edit to my original question