Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JLZ/JZSwipeCell
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.
https://github.com/JLZ/JZSwipeCell
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/JLZ/JZSwipeCell
- Owner: JLZ
- License: mit
- Created: 2013-05-20T05:33:20.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-29T04:56:17.000Z (about 11 years ago)
- Last Synced: 2024-04-25T23:02:27.100Z (7 months ago)
- Language: Objective-C
- Size: 256 KB
- Stars: 180
- Watchers: 18
- Forks: 39
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JZSwipeCell
===========
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
------[Jeremy Zedell](http://github.com/JLZ)
License
-------
JZSwipeCell is available under the MIT license. See the LICENSE file for more info.