AllieCat
AllieCat

Reputation: 3960

UIViewImage push to new UIViewController IN STORYBOARD

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

Upvotes: 0

Views: 683

Answers (1)

hgwhittle
hgwhittle

Reputation: 9426

  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];

Upvotes: 1

Related Questions