左右滑动tableview的cell并做响应,提供两种样式,也可继承SCCellPanBaseGesture自定义样式
效果见下面的演示图

Codes

click to github

以下是写在github里的README

SCCellPanGestureRecognizer


Description

Pan a cell and do sth when end or cancel to pan.
There are two types of panning a cell in this project.
And you can inherite from the class SCCellPanBaseGesture to make your own type.


Display

preivew_gif


How to use

  1. copy the folder SCCellPanGestureRecognizer to your project.

  2. write the code like this:

1
2
3
4
5
6
SCCellPanHorizonGesture *panGes = [[SCCellPanHorizonGesture alloc] initWithTableView:tableView block:^(UITableViewCell *cell, BOOL isLeft) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"tips" message:(isLeft ? @"do sth to \"done\"" : @"do sth to \"delete\"") delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
}];
[panGes buildLeftImgStr:@"icon_list_ok.png" rightImgStr:@"icon_list_del.png"];
[self.view addGestureRecognizer:panGes];
  1. see more details in my demo project.

Thanks

The second type imitate the app called VVebo.
If the author of VVebo do not allow me to imitate, please contact me: Aevitx@gmail.com, and I will delete the code.


License

This code is distributed under the terms and conditions of the MIT license.