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?
1955 次
1 に答える
3
Specify an identifier for the segue in Interface Builder.
Invoke
[self performSegueWithIdentifier:@"yourIdentifierHere" sender:self];
inviewDidLoad
as appropriate.
See Triggering a Segue Programmatically in the View Controller Programming Guide.
于 2012-11-10T17:57:36.737 に答える