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.


    Gesture control without NavigationView

    Pythonista
    3
    6
    1686
    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.
    • Veorra
      Veorra last edited by

      Is there a way to retain the functionality of gesture navigation, eg. swiping right to go back one page, when navigation_bar_hidden is set to true? I was exploring the use of @mikael 's gestures module, but I'm not sure I can apply gestures on anything other than ui subclasses if I'm correct. If anyone could shed light on this, I would be grateful.

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @Veorra last edited by

        @Veorra, gestures module uses iOS gestures, which work on any ui view, not just custom subclasses.

        That said, I have used NavigationView with the title bar hidden and the swipe still worked, but I had to do a little bit extra to hide the title bar:

        n = ui.NavigationView(m, navigation_bar_hidden=False, tint_color='white')
        n.objc_instance.navigationController().navigationBar().hidden = True
        n.present('fullscreen', hide_title_bar=True)
        
        1 Reply Last reply Reply Quote 1
        • Veorra
          Veorra last edited by

          @mikael thank you, that's exactly what I was looking for. For future reference, how can I access documentation for classes that aren't indexed on the pythonista page, for instance 'navigationController'. It seems this workaround requires access to the class but I wouldn't have known it existed were it not for your reply.

          Thanks a bunch again!

          mikael 1 Reply Last reply Reply Quote 0
          • mikael
            mikael @Veorra last edited by

            @Veorra, if I remember right, I noticed that the swipe was not working and googled the issue, coming up with a stack answer related to the same ObjC object.

            I guess one key thing to realize is that most of the view are wrappers around the UIKit views, which can be accessed with view.objc_instance, after which you can dir(...) the available attributes and methods, and look at the related Apple docs.

            1 Reply Last reply Reply Quote 1
            • Veorra
              Veorra last edited by

              Digging through UIKit with Objc utils has indeed turned out to be very useful.
              Although I've stumbled upon a new issue associated with hiding the title bar. It seems if I present a view with the style 'sheet' and dismiss it via swipe, I cannot reopen it without the Exception that the view is already being presented. This does not seem to happen if I dismiss it with the close button on the title bar. Currently looking into this, but if you've encountered this before and care to share a workaround, I'd appreciate it.

              stephen 1 Reply Last reply Reply Quote 0
              • stephen
                stephen @Veorra last edited by stephen

                @Veorra
                possibly make a call to method in your main View class that if you make swipe gester you call self.close() (or objc equivalent lol) this is all the titlebar button does if im correct? should fix this issue and relrive you of titlebar

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