How to add a navigation controller programmatically in code but not as initial view controller

前端 未结 2 520
温柔的废话
温柔的废话 2020-12-28 17:22

I am relatively new to swift and iOS and can\'t find an answer or any help for my problem that works.

I want to create a navigation controller view when I click on a

2条回答
  •  天命终不由人
    2020-12-28 18:13

    var objVC: UIViewController? = storyboard.instantiateViewController(withIdentifier: "ViewController")
    
    var aObjNavi = UINavigationController(rootViewController: objVC)
    

    Now, instead of using view controller object use navigation controller object.

提交回复
热议问题