Make UINavigationcontroller manage UIViewcontroller

Hi ,


I create a UIViewcontroller wib xib file (UIView is in it) , and it works well.


let List = ListViewController(nibName:"ListView", bundle: nil)


But self.navigationController?.pushViewController(buyCoin, animated: true) dose not work.


because self.navigationController? is nil. (that code is in ListViewController )




I can not embed to navigationController in xib file, because only view is in it.


So I want to put uiviewcontroller to uinagationcontroller in programming


Is that possible ?


And I wonder why there is no navigationController.


I thought , if UIViewcontroller is created (init) , it is natually already under uinagationcontroller.


Thanks 🙂