Highlight button while dragging

just started learning iOS SDK. I have several buttons, I need to select them by touching each other once, and then drag. As I understand it, the TouchDragEnter event fires when you click a button, then drag it and then drag it in again. Does any event happen when you click the button outside the button and then drag inside?

+5
source share
1 answer

Alexander

Searching for the same information, I saw that I did not answer your question. You probably already understood this, but here's how I did it.

, pointInside: withEvent: , . touch , .

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
for (UITouch *t in touches) {
    CGPoint touchPoint = [t locationInView:self.view];

    CGPoint testPoint = [self.view convertPoint:touchPoint toView:aButton];
    if ([aButton pointInside:testPoint withEvent:event]) {
        //Do something
    }
    //rest of code
+6

All Articles