I want to get the object at the location of where the touch is lifted (off the screen).
This will be used to implement a drag-and-drop and I have these methods for overriding:
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
Using [[touches anyObject] view]
in touchesEnded:withEvent: gives me the UIView object of where I first touched but not where I released my touch.
Using [[touches anyObject] locationInView:self.view]
does give me the location of where the touch was released but I would have to map the coordinates to UIView.