Latest | 1.1 |
---|---|
Homepage | https://github.com/JLZ/JZSwipeCell |
License | MIT |
Platforms | ios 5.0, requires ARC |
Authors |
Overview
Inspired by MailboxApp (http://mailboxapp.com). A UITableViewCell subclass that makes it easy to add long, short, left and right swiping of content in your table views. Features 4 swipe zones with customizable icons, colors and sizes.
Getting Started
Simple to use. Just subclass JZSwipeCell and add 2 lines of code to add your images and colors.
self.imageSet = SwipeCellImageSetMake([UIImage imageNamed:@"image1"],
[UIImage imageNamed:@"image2"],
[UIImage imageNamed:@"image3"],
[UIImage imageNamed:@"image4"]);
self.colorSet = SwipeCellColorSetMake([UIColor greenColor],
[UIColor redColor],
[UIColor brownColor],
[UIColor orangeColor]);
Then just implement 1 delegate method to receive messages when a swipe is detected.
- (void)swipeCell:(JZSwipeCell*)cell triggeredSwipeWithType:(JZSwipeType)swipeType
{
if (swipeType != JZSwipeTypeNone)
{
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
[tableData removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
// add conditional statement for swipeType
}
}
You can also trigger the swipe animation to run without any swipe occurring.
JZSwipeCell *cell = (JZSwipeCell*)[self.tableView cellForRowAtIndexPath:indexPath];
[cell triggerSwipeWithType:JZSwipeTypeShortRight];
Take a look at the examples for more info. There is one example of subclassing JZSwipeCell with a xib and another without.
Creator
License
JZSwipeCell is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "JZSwipeCell", "version": "1.1", "summary": "UITableViewCell inspired by Mailbox app.", "homepage": "https://github.com/JLZ/JZSwipeCell", "screenshots": "http://jlz.me/images/JZSwipeCell.png", "license": "MIT", "authors": { "Jeremy Zedell": "[email protected]" }, "source": { "git": "https://github.com/JLZ/JZSwipeCell.git", "tag": "1.1" }, "platforms": { "ios": "5.0" }, "source_files": "JZSwipeCell", "requires_arc": true }
Fri, 04 Mar 2016 20:50:03 +0000