views:

346

answers:

2

Given a certain state of one of my UIViews I'd like it to respond to touchesBegan and then cancel any further touchesMoved/Ended that continue from that particular touchesBegan event.

Basically I have an UIView subclass at rest and if it's touched I'd like to move some other UIViews out of the way... then the next time it's touched the responder chain can respond normally to touchesMoved/Ended...

yes, i could check for this state in touchesMoved/Ended but I'm wondering if there's a way to just derail that touch event mid-phase.

+1  A: 

as far as I know, the UIScrollView is able to cancel touches. So I guess there is some way to do that. Sorry I can't provide a more precise solution.

HelloMoon
+1  A: 

I have not tried it, but I take a educated guess.

The first responder is the current recipient of touch events. So resigning as first responder should stop more touch events from coming in. A new touch down will set a new first responder.

[self resignFirstResponder];
PeyloW
Meltemi