0
votes

I implemented SWRevealController in my application. It has two segues one for slideviewcontroller and viewcontroller.

My slideviewcontroller is UITableViewController, I created a new class MenuTableViewController for use as a custom class of that siderbar(slideview). When I add a MenuTableViewController as a custom class of that view, it isn't shown when i slide a menu. If i leave it blank it's shown. The problem is that I want when cell clicked to perform segue identifier or a button clicked, but I don't know where to implement them.

1
Keep calm and use AMSlideMenu: github.com/arturdev/AMSlideMenu And do any customization that can fantasize your brain ;)arturdev
Using your component won't solve his problem (but it looks quite good :-) )Szu

1 Answers

1
votes

You can implement your segue in your tableview's delegate method:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self];
}

You can segue to a proper ViewController depending on indexPath of the selected item inside of that method. Then implement your:

 -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
     if ([segue.identifier isEqualToString:@"YourSegueIdentifier"]) 
     {
      DestinatinoVCClass *destinationVC = (DestinatinoVCClass *)segue.destinationViewController;
      //here you can set any public properties of the destinationVC    
     }
 }

But in general, as far implementing SWRevealController into your app goes here is a full tutorial.