Segue implementation via code

霸气de小男生 提交于 2020-01-05 06:50:52

问题


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:

  1. Create a Segue from your source ViewController (not control) to the destination ViewController.

  2. Give Segue a name on the Interface Builder storyboard file.

  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!