1

I have UIView that can recognize swipe gestures. On swipe, I would like it to behave like a UITableViewCell and show a set of actions (like “Save”, for example).

Any ideas on the best way to achieve that?

My understanding is that I need to implement some sort of animation that makes the view slide to the left and reveal another view that holds the action buttons.

Thanks for all the suggestions and/or pointers in advance.

nambatee
  • 1,478
  • 16
  • 27
  • 1
    see the below link https://stackoverflow.com/questions/32004557/swipe-able-table-view-cell-in-ios-9 – SP74 Jun 21 '17 at 14:27

1 Answers1

2

I'll try to give you a basic idea.

You need to move the view position to left, which is best rather than resizing the view.

One way is to create the views in following manner:

[CellTypeView -ActionView1-ActionView2]

And you can hide the ActionView 1 and 2 by setting their width constraint to 0.

When you swipe, you can do a parallel animation of moving the cell type view to left, and also animating the ActionView1 by changing its width constraint.

Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109