我正在尝试在动画期间触摸图像,并且在触摸时我必须开始另一个动画,但是在动画期间我无法触摸图像请指导我在动画期间是否可以触摸图像?如果不是那么我应该怎么做才能触摸动画图像?
-(void)cheer{
UIEvent *event;
UITouch *touch = [[event allTouches] anyObject];
UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0 ,1024,80, 121)];
[myImageView setImage:[UIImage imageNamed:@"baloon.png"]];
[self.view addSubview:myImageView];
myImageView.userInteractionEnabled=YES;
[UIView animateWithDuration:10 delay:1 options:UIViewAnimationOptionAllowUserInteraction animations:^{
[myImageView setCenter:CGPointMake(512, -1024)];
}
completion:^(BOOL done){
[UIView animateWithDuration:3 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
[myImageView setCenter:CGPointMake(512, -1100)];
}
completion:^(BOOL done){
NSLog(@"ended");
}];
}];
if (touch.view==myImageView) {
NSLog(@"touched");
}
}