0

From questions like this and this, I know how to have a UIViewImage push to a new UIViewController programatically.

But how can I do this in completely in Storyboard? I like Storyboard and would like to not have multiple xib files everywhere.

I've already enable User Interaction through Storyboard, but I still can't create a transition...

enter image description here

Community
  • 1
  • 1
AllieCat
  • 3,890
  • 10
  • 31
  • 45

1 Answers1

1
  1. Drag UIViewController object onto your Storyboard canvas
  2. Select that ViewController and in the top menu bar, click Editor > Embed in > Navigation Controller.
  3. Drag another UIViewController onto the Storyboard
  4. Control drag from the first UIViewController to the new UIViewController and select push from the resulting options.
  5. Click on the Segue that is created and go to the Attributes inspector and enter an Identifier for the Segue.
  6. In the ViewController code where you're handling the UIImageView tap, call [self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self];
hgwhittle
  • 9,316
  • 6
  • 48
  • 60
  • Thanks so much! This seems exactly what I'm looking for. After following your steps, however I get the error: "No visible @interface for 'MyFileName' declares the selector 'performSegueWithIdentifier'" – AllieCat Jul 31 '13 at 18:55
  • You probably need to set your ViewController's appropriate class in the Storyboard. Select the ViewController > Click the Identity Inspector > and set the ViewController's class to the one where you're calling `performSegueWithIdentifier:` – hgwhittle Jul 31 '13 at 18:59
  • 1
    I just needed to change the line to: "[self performSegueWithIdentifier:@"ClickOnConnect" sender: self];" Thanks for the help! – AllieCat Jul 31 '13 at 19:03
  • Oh sorry I forgot that 'sender' argument! – hgwhittle Jul 31 '13 at 19:05