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.


    TableView Swipe Row for More Buttons

    Pythonista
    3
    5
    4874
    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.
    • JustBe
      JustBe last edited by

      I already know how to create a TableView that allows swiping on a row to reveal the Delete button. So...

      How would I make it so that two buttons are revealed after swiping on a row?

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

        The built in ui.TableView supports only one action per row, but you can use the objc_util module to create a custom UITableView and implement the -[UITableViewDelegate tableView:editActionsForRowAtIndexPath: method which returns an array of table view row actions.

        An other option for multiple actions per row would be to simply add an info accessory button to each row and show an alert w/ more options when the accessory button is pressed

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

          Ah, so I may have to learn a little Objective C then. I was hoping to avoid that, but it's good to know my options. Also, I like the accessory button technique you mentioned. Thank you, lukaskollmer.

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

            I should also be possible to create a custom View class that goes into the content_view of your cell. you could implement swipe actions there, or for instance, a scrollview that shows some buttons.

            i may have an example somewhere...

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

              If you have an example, that would be most welcome, JonB.

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