I am facing a dilemma trying to set a UINavigationController
's rootView
UIViewController and UINavigationBar
in the same time. It seems that a UINavigationController
can be either initiated with a rootViewController
as so:
let navController = UINavigationController(rootViewController: someViewController)
or with a UINavigatioBar, like so:
let navController = UINavigationController(navigationBarClass: someUINavigationBar, toolbarClass: nil)
However, I would like to be able to add a rootViewController as well as a custom UINavigationBar
. Is there any way to do so?
I've tried setting the UINavigationBar
like navController.navigationController?.navigationBar = MyNavigationBar
however, it seems that navigationController?.navigationBar is only a getter.