简体   繁体   English

推送到UINavigationViewController

[英]Pushing to UINavigationViewController

I'm doing a login view, which retrieves data and when everything goes well it should move from Login View (UIViewController) to the Navigation controller(UINavigationController) which in his turn should serve as root view controller and move the user to the main view(UIViewController). 我正在做一个登录视图,它检索数据,当一切顺利时,它应该从登录视图(UIViewController)移至导航控制器(UINavigationController),而导航控制器又应充当根视图控制器,并将用户移至主视图(UIViewController)。 The problem is when i reach to the code that works just fine with me inside other classes, it does nothing here, not even throwing exceptions to handle here's my code 问题是当我到达在其他类中可以正常使用的代码时,它在这里什么也不做,甚至没有抛出异常来处理这是我的代码

   func moveToMainView(){
    let navigationControllerView = self.storyboard?.instantiateViewControllerWithIdentifier("NavControllerView") as! UINavigationController

    self.navigationController?.pushViewController(navigationControllerView, animated: true)

}

I searched to find if there any special case for UINavigationController, but no luck so far... hope you can help me 我搜寻了UINavigationController是否有任何特殊情况,但到目前为止还没有运气...希望您能对我有所帮助

I've worked around the issue and placed the log-in view controller after the UINavigationController, and because there's usually no navigation bar at the log-in view, i've hidden the navigation bar and showed it back again after the user logged in "when showing the MainViewController". 我已经解决了这个问题,并将登录视图控制器放置在UINavigationController之后,并且由于登录视图通常没有导航栏,因此我隐藏了导航栏,并在用户登录后再次显示了它。 “显示MainViewController时”。 Hope this work around helps other people that run to this problem 希望这种解决方法可以帮助遇到此问题的其他人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM