简体   繁体   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

I tried doing this. 我尝试这样做。

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

from Nib you can do it as following, in my case "MusicCategoryVC" is my ViewController. 在Nib中,您可以按照以下步骤进行操作,在我的情况下,“ MusicCategoryVC”是我的ViewController。

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

暂无
暂无

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

相关问题 推送没有 storyboard 的 ViewController - push ViewController without storyboard 如果没有Storyboard,如何初始化自定义ViewController? - How do I initialize a custom ViewController when there's no Storyboard? 如何遍历 storyboard 个元素而不必写出所有内容? - How do I iterate through storyboard elements without having to write out everything? 我有多个情节提要。 如何使用AppDelegate在另一个情节提要中打开另一个ViewController? (Segue) - I have multiple storyboards. How can I use AppDelegate to open another ViewController in another storyboard? (Segue) 如何将 menuType 连接到另一个视图控制器? - How do I connect a menuType to another viewcontroller? 我如何将 .xib ViewController 转到 Storyboard ViewController 并再次将 Storyboard 转到 .xib ViewController - How can i go .xib ViewController to storyboard ViewController and again storyboard to .xib ViewController 如何摆脱Sigabrt错误? 我尝试过多种方式 - How do I get rid of this Sigabrt error? I've tried Multiple Ways 我在xcode的viewcontroller.swift中的一个按钮中编码 - 如何让它在故事板中显示? - I coded in a button in xcode's viewcontroller.swift - How do I get it to show in storyboard? 如何在不离开窗口的情况下让我的NSViewController进入另一个ViewController? - How do I get my NSViewController to go into another ViewController without leaving the window? 如何创建一个只有屏幕一半高度的 ViewController? - How do I create a ViewController that is only half the height of the screen?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM