繁体   English   中英

如何在没有情节提要文件的情况下将另一个viewController推到屏幕上? 我已经尝试了以下代码,但没有任何反应

[英]How do to I push another viewController to the screen without having storyboard file ? I've tried the following code but nothing happens

我尝试这样做。

let vc = AdminInfo() as UIViewController
self.navigationController?.pushViewController(vc, animated: true)

在Nib中,您可以按照以下步骤进行操作,在我的情况下,“ MusicCategoryVC”是我的ViewController。

   let nextvc = MusicCategoryVC(nibName: "MusicCategory", bundle: nil)
   navigationController?.pushViewController(nextvc, animated: true)

暂无
暂无

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

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