第一次通话有什么区别?
let next = self.storyboard?.instantiateViewController(withIdentifier: "AFVC") as! AddFileViewController
self.present(next, animated: true, completion: nil)
第二秒:
let dashboard = self.storyboard?.instantiateViewController(withIdentifier: "DBVC") as! DashboardViewController
self.navigationController?.pushViewController(dashboard, animated: true)
答案 0 :(得分:1)
首次使用将展示新的视图控制器。此演示文稿通常将新控制器从底部向上滑动。如果要返回,则需要创建一个按钮或类似的按钮来关闭它。
第二种用法将使用导航控制器(通过通常从右侧滑入的推动)显示新的视图控制器。您将在导航栏中自动获得“ <返回”按钮。但这仅在调用视图控制器已嵌入导航控制器中时才有效,否则self.navigationController
为nil
。