我尝试这样做。

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)

关于swift - 如何在没有 Storyboard 文件的情况下将另一个viewController推送到屏幕?我已经尝试了以下代码,但没有任何 react ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51751234/

10-12 03:13
查看更多