takashisite / TSPopover

UIPopover like UI for iPhone
Other
316 stars 68 forks source link

open TSActionSheet when select row in table view #2

Closed Piero87 closed 12 years ago

Piero87 commented 12 years ago

Hello, great project, really really really great project!!! i have a question, i want display the TSActionSheet when i click on a row in a table view, so i want display it in this method:

but TSActionSheet require an event, here:

[actionSheet showWithTouch:event];

how i can do?

takashisite commented 12 years ago

I just added new method for open popover with tableview cell.
Example,

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

    TSActionSheet *actionSheet = [[TSActionSheet alloc] initWithTitle:@"title"];
    [actionSheet addButtonWithTitle:@"button one" color:[UIColor whiteColor] titleColor:[UIColor darkGrayColor] borderWidth:1 borderColor:[UIColor grayColor] block:^{
            NSLog(@"pushed button one");
    }];

    [actionSheet addButtonWithTitle:@"button two" color:[UIColor whiteColor] titleColor:[UIColor darkGrayColor] borderWidth:1 borderColor:[UIColor grayColor] block:^{
                NSLog(@"pushed button two");
    }];

    [actionSheet showWithCell:cell];
}
Piero87 commented 12 years ago

sorry if i write you now, but i'm busy in these day, however, you have done again a great work! on the table view cell works perfectly! thanks!