在ss中,我们可以使用Interface Builder设置Storyboard id,但我不想使用它,那么是否可以通过编程实现呢?如果是,请给我任何解决方案。
在ss中,我们可以使用Interface Builder设置Storyboard id,但我不想使用它,那么是否可以通过编程实现呢?如果是,请给我任何解决方案。
当您以编程方式创建VC时,您不需要使用标识符加载它,只需要
let first = FirstVC()
// 在 AppDelegate
的 didFinishLaunchingWithOptions
方法中,你应该使用以下代码:
self.window?.rootViewController = UINavigationController(rootViewController: first)
然后在第一个元素内部
let second = SecondVC()
self.navigationcontroller?.pushViewController(second,animated:true)
let viewController = MyViewController()
)。 - Kyle Bashour