omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Interacting with UITouches

    Pythonista
    objcutil objc
    3
    8
    5110
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • filippocld
      filippocld last edited by filippocld

      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

      1 Reply Last reply Reply Quote 0
      • Webmaster4o
        Webmaster4o last edited by

        Pretty sure @ProfSpaceCadet did this in his screen recorder.

        1 Reply Last reply Reply Quote 0
        • filippocld
          filippocld last edited by

          True, more or less it is what i need. Any other way?

          Webmaster4o 1 Reply Last reply Reply Quote 0
          • Webmaster4o
            Webmaster4o @filippocld last edited by

            @filippocld Why doesn't his method work?

            1 Reply Last reply Reply Quote 0
            • filippocld
              filippocld last edited by

              It works, but i was looking for more and simpler solutions. If this is the only way it's good :-)

              1 Reply Last reply Reply Quote 0
              • omz
                omz last edited by

                I think you'd have to be a bit more specific about what you're actually trying to achieve...

                1 Reply Last reply Reply Quote 0
                • omz
                  omz last edited by

                  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')
                  
                  1 Reply Last reply Reply Quote 2
                  • filippocld
                    filippocld last edited by

                    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. :-)

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors