Segue Fires but screen doesn't transition

岁酱吖の 提交于 2019-12-11 17:33:08

问题


Using storyboards, I have a view controller which segues to another.

I have two segues, one from a button and one from the view controller.

I want to fire the view controller segue programmatically based on certain conditions, so in the viewDidLoad method of the first screen I call

[self performSegueWithIdentifier:@"SkipName" sender:self];

Using the debugger I can see that prepareForSegue gets called, but the view doesn't move on. Any help greatly appreciated.


回答1:


Putting it in viewDidAppear did the trick, thanks @danielbeard !

Also, to use a push segue the views need to belong to a navigation controller. You dont' get any errors, it just doesn't work.



来源:https://stackoverflow.com/questions/10222798/segue-fires-but-screen-doesnt-transition

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