[英]Swift loading ViewController on TableViewCell Design
As I understand it, one of the best ways of handling opening Views upon clicking a particular tableViewCell is by pushing to the ViewController. 据我了解,单击特定tableViewCell时处理打开View的最佳方法之一是推送到ViewController。
However, this apparently only works if you only embed the ViewController in a NavigationController. 但是,这仅在您仅将ViewController嵌入NavigationNavigator中时才有效。
Would you then have to embed each individual ViewController in an Navigation Controller? 然后,您是否必须将每个ViewController嵌入到导航控制器中?
This sounds sort of repetitive and tedious - is this good practice? 这听起来有点重复和乏味-这是好习惯吗?
This tutorial uses navigation controllers on all of the view controllers, but doesn't really say why 本教程在所有视图控制器上使用导航控制器,但并未真正说明原因
I just use one navigation controller, and it works fine for me. 我只使用一个导航控制器,它对我来说很好用。 I've used one and had segues between multiple viewControllers including several tables as well as using buttons in some places, and still been able to navigate super easily. 我已经使用过一个,并且在多个viewController之间进行了搜索,包括多个表以及在某些地方使用按钮,并且仍然能够超级轻松地导航。 In main.storyboard, just select the first view that's going to be a part of it, then go to Editor>Embed In>Navigation Controller. 在main.storyboard中,只需选择将成为其中一部分的第一个视图,然后转到Editor> Embed In> Navigation Controller。 Then, you just add in your segues (I believe they should all be Show(eg Push) segues to work correctly) When running your app, there should be a bar at the top which can be used to go back (you can also edit the bar by adding other buttons or changing the color and title). 然后,您只需添加您的序号(我相信它们都应该是Show(例如Push)序号才能正常工作)在运行您的应用程序时,顶部应该有一个栏可以用来返回(您也可以编辑通过添加其他按钮或更改颜色和标题来添加该栏)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.