I wish to drag a UIImage on to one of several UIButtons and have it repositioned based on which button I drag it to.
The problem I\'ve ran in to is that UITouch only
Assuming there is a @property of the target view in your container, and the target view is added to the container:
@property (nonatomic, strong) UIView* targetView;
// ...
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSSet* touchesForTargetView = [event touchesForView:self.targetView];
if (touchesForTargetView.allObjects.count != 0) {
// touch was at target view
}
else {
// touch was somewhere else
}
}