showMenu forCell Animated

37 views
Skip to first unread message

Trausti Thor Johannsson

unread,
Jan 2, 2011, 6:22:34 AM1/2/11
to three20
Hi all,

Can someone please explain the function in TTTableViewController
called - (void)showMenu:(UIView*)view forCell:(UITableViewCell*)cell
animated:(BOOL)animated;

I have been googling all over, but can't find an a-z explanation.
Most that is out there only just says "just implement this function
and you are done" but that is not the whole truth.

So does any one have a clue as to what I need to do ?

Best regards,


Trausti

Dennis

unread,
Jan 4, 2011, 3:21:58 PM1/4/11
to Three20
Hey,

I can't explain how to use it, but afaik it's the function that you
see in the facebook app if you tap the + to like an item.

But you probably knew that already... :(

Ben M

unread,
Jan 6, 2011, 4:11:27 PM1/6/11
to Three20
Any luck on this? I'm curious how to use this function as well...

On Jan 2, 3:22 am, Trausti Thor Johannsson <traust...@gmail.com>
wrote:

mapedd

unread,
Jan 17, 2011, 5:53:20 PM1/17/11
to Three20
Hi, can anybody paste some code snippet how to use showMenu methood?

Nirav

unread,
Jan 18, 2011, 6:22:59 AM1/18/11
to Three20
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.
Reply all
Reply to author
Forward
0 new messages