Reputation: 1
I am facing an issue of NavigationBar, I dont want it in subview (child view), I also used setNavigationBarHidden()
method to hide but it is not working.
class VehicleSavingPopupViewController: UIViewController {
@IBOutlet weak var bottomView: UIView!
@IBOutlet weak var backGroundView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
animateView()
backGroundView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(backGroundViewTapped(_:))))
// Do any additional setup after loading the view.
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: false)
}
private func animateView(){
UIView.animate(withDuration: 0.5, delay: 0, options: [.transitionCurlDown],
animations: { [weak self] in
guard let self = `self` else {return}
self.bottomView.center.y -= self.bottomView.bounds.height
}, completion: nil)
}
Upvotes: 0
Views: 67
Reputation: 179
I set this in my own navigationController class but it should work in your viewDidLoad() method as well.
navigationController?.navigationBar.isHidden = true
Upvotes: 0