如何在没有故事板文件的情况下将另一个视图控制器推送到屏幕上?我尝试了以下代码,但没有任何反应



我试过这样做。

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)

最新更新