Just something I wrote up really quickly to give you an example. This
is assuming you have a TTTableViewController and you wanted to detect
swipes on the cells and show a menu (a la Twitter app).
- (void)viewDidLoad {
UISwipeGestureRecognizer* recognizer = [[UISwipeGestureRecognizer
alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionRight |
UISwipeGestureRecognizerDirectionLeft)];
[[self view] addGestureRecognizer:recognizer];
[recognizer release];
[super viewDidLoad];
}
-(void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer {
CGPoint gestureStartPoint = [recognizer
locationInView:self.tableView];
TTTableViewCell* cell = (TTTableViewCell*)[self.tableView
cellForRowAtIndexPath:[self.tableView
indexPathForRowAtPoint:gestureStartPoint]];
TTView* backView = [[TTView alloc]
initWithFrame:cell.contentView.frame];
// Add stuff to your back view here
[self showMenu:backView forCell:cell animated:YES];
}
This sort of should give you an idea of how to use showMenu.