Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Get touch position #71

Open
lm2343635 opened this issue Feb 3, 2017 · 1 comment
Open

Get touch position #71

lm2343635 opened this issue Feb 3, 2017 · 1 comment

Comments

@lm2343635
Copy link
Contributor

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

@Oliveck10
Copy link

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))
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants