TouchVisualizer icon indicating copy to clipboard operation
TouchVisualizer copied to clipboard

Get touch position

Open lm2343635 opened this issue 9 years ago • 1 comments

How can I get touch positions(x and y) from Visualizer?

lm2343635 avatar Feb 03 '17 04:02 lm2343635

You can start the visualizer in viewDidLoad() Visualizer.start()

Then you can call the .getTouches() function in the scope (ex: function) you want let touches = Visualizer.getTouches()

Finally, You can easily go through the touches ([UITouch]) by

for touch in touches { 
    print(touch.location(in:theViewYouWant))
}

Oliveck10 avatar Jun 06 '18 09:06 Oliveck10