views:

108

answers:

1

I've set up a UISwipeGestureRecognizer:

UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:delegate action:@selector(handleSwipeGesture:)];
swipe.direction = UISwipeGestureRecognizerDirectionUp;
[self addGestureRecognizer:swipe];
[swipe release];

A swipe makes the player move in the direction of the swipe. I need the player to keep moving, though, until the finger that made the swipe is lifted off the screen. I've tried using the touchesEnded: method but it requires that a non-swiping touch be made first. How can I get the touch that made the swipe gesture? How can I detect when that touch is lifted off the screen?

A: 

After looking through Apple's documentation, I found this property of UIGestureRecognizer:

@property(nonatomic) BOOL cancelsTouchesInView

Setting it to NO lets the receiver's view handle all touches that are part of the multi-touch sequence the gesture recognizer receives.

Arseniy Banayev