Answer the question
In order to leave comments, you need to log in
How to implement transition to another View Controller through SWTableViewCell?
Following the tutorial from here ( www.appcoda.com/swipeable-uitableviewcell-tutorial ), the question arose: how, for example, from the right More button to switch to another screen?
The standard code from the tutorial for showing a UIActionSheet when clicking More.
- (void)swipeableTableViewCell:(SWTableViewCell *)cell didTriggerRightUtilityButtonWithIndex:(NSInteger)index {
switch (index) {
case 0:
{
// More button is pressed
UIActionSheet *shareActionSheet = [[UIActionSheet alloc] initWithTitle:@"Share" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Share on Facebook", @"Share on Twitter", nil];
[shareActionSheet showInView:self.view];
[cell hideUtilityButtonsAnimated:YES];
break;
}
}
Answer the question
In order to leave comments, you need to log in
A small prelude:
If you are just learning, and iOS 7 support is not important to you, it is better to look towards the standard api
, see the tableView:editActionsForRowAtIndexPath method
An example of how to use it here , towards the end
And the transition to another "screen" is done in the simplest case
-(void)buttonizeButtonTap:(id)sender{
[self performSegueWithIdentifier:@"Associate" sender:sender];
}
the question arose: how, for example, from the right More button to switch to another screen?
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"ShowMoreSegue" sender:nil];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question