1

Now I use wizard to create a segue, but I want it to be Objective C code. Below is my picture of my segue that I want it to be code. Help me please because It is really helpful to me.

enter image description here

Pheng Sengvuthy
  • 260
  • 2
  • 9

1 Answers1

2
UIViewController *nextVC = [self.storyboard instantiateViewControllerWithIdentifier:@"nextVCIdentifier"];
MyCustomSegue *segue = [[MyCustomSegue alloc] initWithIdentifier:@"" source:self destination:nextVC];
[self prepareForSegue:segue sender:sender];
[segue perform];

Simple example. You need to change MyCustomSegue = SWRevealControllerSegue.

Martin Le
  • 719
  • 7
  • 14
  • What can MyCustomSegue be? – Pheng Sengvuthy Mar 13 '16 at 04:18
  • @SengvuthyPheng If like your picture, it is SWRevealControllerSegue. – Martin Le Mar 13 '16 at 04:18
  • Hoo I thank you. I used to put it and coded like that, but it has shown me nothing? what is wrong? – Pheng Sengvuthy Mar 13 '16 at 04:20
  • I wonder one more about [self prepareForSegue:segue sender:sender];. What is it ? I don't have sender because I put it in table didselectcell. How can I do? – Pheng Sengvuthy Mar 13 '16 at 04:22
  • sender : The object that initiated the segue. You might use this parameter to perform different actions based on which control (or other object) initiated the segue. So, sender here is your selected cell. You should input this code in didselectcell like u said – Martin Le Mar 13 '16 at 04:27