0

I use this code when i move the button but the event is disabled during the transition

what can i do to tap when is moving? here is my code...

    button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(210, 285, 120, 118);
    [button setTitle:@"" forState:(UIControlState)UIControlStateNormal];
    [button addTarget:self action:@selector(botonTap:) forControlEvents:(UIControlEvents)UIControlEventTouchDown];

    [button setBackgroundImage:[UIImage imageNamed:@"car.png"] forState:UIControlStateNormal];

    [self.view addSubview:button];

moving over screen and disabled event to finish :(

[UIView animateWithDuration:10
                      delay:0.0f
                    options: UIViewAnimationOptionAllowUserInteraction |
 UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionCurveEaseIn
                 animations:^{

                     button.frame = CGRectMake(0, 4, 120, 118);

                 }
                 completion:^(BOOL finished){

                 }];

Dont Enter at this method when tap the button, only works at stop :(

-(IBAction)botonTap:(id)sender {
    button.alpha=0;
}
Fabio
  • 1,913
  • 5
  • 29
  • 53

0 Answers0