Search code examples
iosswiftswift4navigationbarswift5

Navigation bar appear on click on view


I attach the video of my issue. When i click on anywhere in viewcontroller navigation bar is appear

override func viewWillAppear(_ animated: Bool) {
    self.navigationController?.setNavigationBarHidden(true, animated: true)
    self.navigationController?.isNavigationBarHidden = true
    self.navigationController?.hidesBarsOnTap = true
}

The above code added on viewwillappear its working on initially but when I click anywhere on screen navigationbar is appear.


Solution

  • Finally this solutions work for me

    self.navigationController?.navigationBar.transform = CGAffineTransform(translationX: 0, y: -200)