views:

23

answers:

2

I've read several topics to moving a UIButton and can touch the button when its moving. Now i'm using a UIView beginAnimation, but the button can't be touched when its moving.

I've also read something about a NSTimer, but this is not the best way to do in my project.

Is there another way, someone has the same problem?

Thanks for any help! :)

A: 

There is a chance that while the botton is animating, your main thread is locked up, which makes it so no interface interaction can be processed. Can you press other things while the button is animating?

If not, move your animation to a background thread.

DexterW
Yes i can touch other buttons, that don't move
iMuller
post some code that handles the animation.
DexterW
A: 

Here my example code..

UIButton *buttonTapObject = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[buttonTapObject addTarget:self action:@selector(tapObjectTapped:) forControlEvents:UIControlEventTouchUpInside];
buttonTapObject.tag = 100;
buttonTapObject.frame = CGRectMake(-80.0, 40.0, 80.0, 80.0);

[UIView beginAnimations:@"example" context:NULL];
[UIView setAnimationDuration:2.0];

// Move to right

buttonTapObject.center = CGPointMake(360.0, 100.0);

[UIView commitAnimations];
iMuller
Any one can help me?
iMuller