Skip to content

Commit

Permalink
- Updated README.md and code example for Pan gesture implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamztang committed Feb 20, 2012
1 parent 6cad724 commit 9e5b195
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions JTGestureBasedTableView/JTTableViewGestureRecognizer.h
Expand Up @@ -38,12 +38,13 @@ extern CGFloat const JTTableViewCommitEditingRowDefaultLength;
- (NSIndexPath *)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer willCreateCellAtIndexPath:(NSIndexPath *)indexPath;
- (CGFloat)heightForCommittingRowForGestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer;

// Panning
- (void)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer didChangeContentViewTranslation:(CGPoint)translation forRowAtIndexPath:(NSIndexPath *)indexPath;
// Panning (required)
- (BOOL)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer canEditRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer didEnterEditingState:(JTTableViewCellEditingState)state forRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer commitEditingState:(JTTableViewCellEditingState)state forRowAtIndexPath:(NSIndexPath *)indexPath;
// Panning (optional configuration)
- (CGFloat)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer lengthForCommitEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)gestureRecognizer:(JTTableViewGestureRecognizer *)gestureRecognizer didChangeContentViewTranslation:(CGPoint)translation forRowAtIndexPath:(NSIndexPath *)indexPath;

@end

Expand Down
7 changes: 2 additions & 5 deletions JTGestureBasedTableViewDemo/ViewController.m
Expand Up @@ -31,13 +31,10 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// In this example, we setup self.rows as datasource
self.rows = [NSMutableArray arrayWithObjects:
@"Swipe to the right to complete",
@"Swipe to left to delete",
@"Drag down to create a new cell",
@" ",
@" ",
@"Pinch between any cell to create a new one",
@" ",
@" ",
@" ",
nil];
}
return self;
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -19,15 +19,17 @@ Demo

<img src=https://github.com/mystcolor/JTGestureBasedTableViewDemo/raw/master/demo1.png width=320></img>
<img src=https://github.com/mystcolor/JTGestureBasedTableViewDemo/raw/master/demo2.png width=320></img>
<img src=https://github.com/mystcolor/JTGestureBasedTableViewDemo/raw/master/demo3.png width=320></img>


Features
--------

It only supports two features at the moment.
It only supports three features at the moment.

- Pull down to add cell
- Pinch to create cell
- Panning on cell gesture

How To Use It
-------------
Expand Down
Binary file added demo3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9e5b195

Please sign in to comment.