Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Created August 14, 2014 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MortimerGoro/ab1dd3963a021e3c2c2f to your computer and use it in GitHub Desktop.
Save MortimerGoro/ab1dd3963a021e3c2c2f to your computer and use it in GitHub Desktop.
MGSwipeTableCell right buttons
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * reuseIdentifier = @"cell";
MGSwipeTableCell * cell = [self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
if (!cell) {
cell = [[MGSwipeTableCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
}
cell.textLabel.text = @"Title";
cell.detailTextLabel.text = @"Description";
cell.rightButtons = @[[MGSwipeButton buttonWithTitle:@"Delete" backgroundColor:[UIColor redColor]],
[MGSwipeButton buttonWithTitle:@"More" backgroundColor:[UIColor lightGrayColor]]
];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment