Jordi Kroon
Jordi Kroon

Reputation: 2597

Swipe table cell vertical menu

I am developing a app and I want to create a swappable menu. I have found some libraries like MCSwipeTableViewCell.

The problem with these libraries is that I am not be able to add a vertical menu, only a horizontal menu.

How am I able to develop a swipable menu (see screenshot).

Any help is welcome :-)

Screenshot: Screensnap

Upvotes: 0

Views: 453

Answers (2)

GoodSp33d
GoodSp33d

Reputation: 6282

Well I know its kinda late. Since this was left unanswered ... Have a look at this library. As of now only portrait mode is supported.

enter image description here

Upvotes: 1

Kasper Munck
Kasper Munck

Reputation: 4191

MCSwipeTableViewCell gives you a UITableViewCell subclass with up to four swipe options (that is, buttons that are revealed when swiping either left or right on the cell). I'm sure you're already aware of this.

MCSwipeTableViewCell implements only horizontal swipe-buttons. That is, you could provide a view with three vertically arranged buttons (corresponding to your requirements) as one of the swipe-buttons in a cell instance's setSwipeGestureWithView:color:mode:state:completionBlock: method, but then you wouldn't be able to tell which button was pressed. I suppose you want to know which vertical button was tapped.

However, creating a swipeable cell is not that difficult. You could seek inspiration in MCSwipeTableViewCell's implementation (it is open source after all). A good place to start could be the handlePanGestureRecognizer: method. A fair amount of the swiping logic is implemented in this here and the code is pretty clear and understandable.

Other great soruces of inspiration are TeehanLax's UITableViewCell-Swipe-for-Options or runmad's RMSwipeTableViewCell.

Upvotes: 0

Related Questions