Question

I have a UIButton (a subclass of one, actually) that interacts with the user via the touchesbegan: and touchesmoved: functions.

What I would like is for the user to be able to press down the button, drag their finger away, and have a second finger touch the button (all while the first finger has never left the screen).

Problem is, the second touch event never calls touchesbegan: unless the first finger has been released.

Is there some way to override this, or am I trying to do the impossible?

Was it helpful?

Solution

Have you tried setting multipleTouchesEnabled to YES?

OTHER TIPS

If the interactions are using touchesbegan: and touchesmoved: then use a UIView instead of a UIButton. A button is a UIControl, and the way to interact with UIControls is

- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents.

I'm not sure this two ways of getting events mix well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top