问题
I am a newbie in IOS. I am creating an Authorization Scene in a Storyboard. It consists of textFields (username, password) and buttons (Log In, Sign Up). When login and password are correct, UIAlertView is displayed with text "Success". After this, MainScene should be displayed. But I can't create a segue in Interface Builder. How can I implement it via code?
回答1:
Here is what you can do:
Create a Segue from your source ViewController (not control) to the destination ViewController.
Give Segue a name on the Interface Builder storyboard file.
Perform Segue programmatically:
[self performSegueWithIdentifier:@"MySegueIdentifier" sender:nil];
Note: To create Segue from a ViewController, hold control down and drag source ViewController instead of a control as you would normally do, to the destination controller.
来源:https://stackoverflow.com/questions/18833184/segue-implementation-via-code