Q:

Global Event handler for Touch Up Inside

I have a touch operation that is a trigger for resize kind of scenario, where the operation starts on touches move, and needs to end on touchesEnded.  The thing is, that the touchesEnd could be on a different UI View, since the user is dragging the finger.  How do I register a *global" touchesEnded listener? 

A:

You should use a UIPanGestureRecognizer.  Each time it triggers, check the state of the gesture recognizer.  If it's UIGestureRecognizerStateBegan then the view is first being touched, if it's UIGestureRecognizerStateChanged then the user is moving his finger, if it's UIGestureRecognizerStateEnded then the user has lifted his finger. 
As long as the gesture starts on your view it will continue (unless cancelled) even after leaves the bounds of the view, so you don't need to worry about "making it global". 
Initialize the gesture recogniser with:
UIPanGestureRecognizer *dragViewGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleDragView:)];
dragViewGestureRecognizer.maximumNumberOfTouches = 1;
[yourView addGestureRecognizer:dragViewGestureRecognizer];

Then fill out the following method with the code you need:
- (void)handleDragView:(UIPanGestureRecognizer*)panGestureRecognizer {
    switch (panGestureRecognizer.state) {
        case UIGestureRecognizerStateBegan: {
            //Code when dragging starts
            break;
        } case UIGestureRecognizerStateChanged: {
            //Code while dragging is happening (if needed)
            break;
        } case UIGestureRecognizerStateEnded: {
            //Code when dragging ends
            break;
        }
        default:
            break;
    }
}

