just started to explore iOS SDK. I have some buttons, need to highlight them touching outside once and then drag. As I understand, TouchDragEnter event fires when you click the button then drag outside then drag inside again. Is there any event fires when you click outside the button and then drag inside?
Alexander,
Searching for the same info, I saw your question hadn't been answered. You've probably already figured it out, but here's how I've done it.
Note that the pointInside:withEvent: method checks to see if the point lies within the button's bounds. Since the touch event is coming from the view, you have to convert it to the button's coordinate system.
-(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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With