I am trying to open new UIViewController with navigation bar when button is clicked.
But I can not see the navigation bar. I only see what I gave the background color.
Here is my code to show my UIViewController
@objc func ActionButtonTapped() {
let nav = UINavigationController(rootViewController: UploadTweetController())
nav.modalPresentationStyle = .fullScreen
present(nav, animated: true, completion: nil)
}
and viewDidLoad function of controller
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red
}
I also tried nav.isNavigationBarHidden = false and nav.NavigationBar.isHidden = false but did not work.