1

I am new to storyboards, but in my new app I have created 2 view controllers. On the storyboard, I have connected them with a modal segue. I would like to launch the modal view controller based on a certain condition in the "viewDidLoad" method of the first view controller. What is the correct way to do this so that I could change the transition in InterfaceBuilder if I wanted?

4

1 に答える 1

3
  1. Specify an identifier for the segue in Interface Builder.

  2. Invoke [self performSegueWithIdentifier:@"yourIdentifierHere" sender:self]; in viewDidLoad as appropriate.

See Triggering a Segue Programmatically in the View Controller Programming Guide.

于 2012-11-10T17:57:36.737 に答える