Programmatically navigate to another view controller/scene

后端 未结 19 3287
一向
一向 2020-11-27 11:29

I got an error message during navigating from first view controller to second view controller. My coding is like this one

let vc = LoginViewController(nibNam         


        
19条回答
  •  星月不相逢
    2020-11-27 12:09

    Swift3:

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewController("LoginViewController") as UIViewController
    self.navigationController?.pushViewController(vc, animated: true)
    

    Try this out. You just confused nib with storyboard representation.

提交回复
热议问题