ios - How to drag the cell on right in UITableView when tap, like in Snapchat? -
in snapchat application on main screen if tapped on cell contact - cell drag left right (look @ screen). how can this?
p.s. similar effect has ios lock screen when tap on camera on right bottom corner.
- add
pangesturerecognizer
tableview
. - track gesture recognizer states, , check
translation.x
value see position of drag. - get view of drag = cell have.
- shift position of cell based on
translation.x
value, , @ time, move whatever view want show beneath it. [note: if want view slide left right, usetranslation.x
value. - check threshold of movement, if exceeds, leave view open. if not exceed, animate view cell's frame set normal.
[you can use velocity
property along translation
- gives user better experience. same swipe]
p.s. if still don't it, suggest google 'ios uitableviewcell swipe reveal` sure find plenty of examples.
peace.
Comments
Post a Comment