I have, for example, a UIButton that I placed in IB.
This UIButton has two functions depending on whether it is just touched up inside or dragged outside – it would be nice to at least keep it functioning for touch up inside.
I want to click on my button and ‘drag outside’ but use -touchesEnded over a rectangle when I finally release my click.
I know that one option is to ditch the UIButton and use -touchesBegan over a mask, but that is a lot more effort and requires a nice big rewrite (considering the 96 buttons).
So to rephrase slightly – I’ve clicked on a button and held down the mouse, while dragging the cursor (/finger) over to a different point in my view and I want my view to recognise a -touchesEnded when I finally let go. The problem is that the initial click is tied up in the button so -touchesEnded in my main view doesn’t happen…
Am i trying to do this the wrong way? Also, am I being clear?
EDIT: @Heckman has phrased the question well below
If I understand your question correctly, you are touching one button, that is contained within some UIView, and want to be able to drag your finger out, and recognize the point in the buttons superview.
Sounds to me like you should detect the button press from the button, then make a call to the
[UIButton superview], to tell the superview about the button pressing that started, and then handle the touch end within the view.To notify the superview of the button that was pressed call something like (from your UIButton):
In your superview code (if you have a property buttonPressed):