Hi all,
I was thinking UITouches and some cool things i can do with them. The problem is i don't know how to detect a touch ( in real objc i used touchesBegan but i dont think it is possible in pythonista).
Is there another way to detect touches?
Thanks in Advance,
Filippo
Forum Archive
Interacting with UITouches
filippocld
Mar 16, 2016 - 20:08
Webmaster4o
Mar 16, 2016 - 22:01
Pretty sure @ProfSpaceCadet did this in his screen recorder.
filippocld
Mar 16, 2016 - 22:09
True, more or less it is what i need. Any other way?
Webmaster4o
Mar 16, 2016 - 22:23
@filippocld Why doesn't his method work?
filippocld
Mar 16, 2016 - 22:36
It works, but i was looking for more and simpler solutions. If this is the only way it's good :-)
omz
Mar 16, 2016 - 22:51
I think you'd have to be a bit more specific about what you're actually trying to achieve...
omz
Mar 16, 2016 - 22:56
Perhaps worth noting: ui.Touch can be "bridged" to ObjC, e.g. you could get access to a UITouch instance like this:
import ui
from objc_util import ObjCInstance
class MyView (ui.View):
def touch_began(self, touch):
ui_touch = ObjCInstance(touch)
print(ui_touch)
MyView().present('sheet')
filippocld
Mar 17, 2016 - 07:50
Thanks, i didn't think about ui. The @ProfSpaceCadet example was goot but was a bit overkill for now.Currently I am experimenting with the ui method. :-)