Push to root View controller in UIStoryboard

坚强是说给别人听的谎言 提交于 2019-12-04 22:33:18

Right click on your D viewcontroller and drag i to your A viewcontroller.

Then click on the object which appears on the line you just created.

Write something like DtoA in the storyboard segue identifier in the attributes inspector.

Now in D view controller, just do:

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

And if you instead wish to pop to a previous viewcontroller the old fashioned way, like from D to B:

UINavigationController* navController = self.navigationController;
UIViewController* Bviewcontroller = [navController.viewControllers objectAtIndex:1];
[navController popToViewController:controller animated:YES];

I hope this helps!

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