Find your finger moving in the iPhone SDK

My problem is creating a control somewhat similar to apple magnifying glass in text control mode, where you touch a second or so to open the magnifying glass, and then drag your finger to select the desired location.

I created all the methods that I need to detect a long fixed touch. Now I need to determine the UIView that my finger has slipped. I'm not quite sure how to do this, can someone point me in the right direction?

+3
source share
2 answers

Any UIView that should report that it has been affected can detect a touch using the inherited UIResponder methods.

touchesBegan:withEvent:touchesMoved:withEvent:touchesEnded:withEvent:touchesCancelled:withEvent:

UIViews, , , , . - , .

, ..:

[[self superview] touchesBegan:touches withEvent:event];

, .

+2

, , , . . .

//Just detected that the finger is stationary
MyView *touchedView = [containerView hitTest:touchPoint withEvent:event];
[touchedView performSomeAction];

, , , , .

0

Source: https://habr.com/ru/post/1757922/


All Articles