No Swipe Back when hiding Navigation Bar in UINavigationController

前端 未结 18 681
生来不讨喜
生来不讨喜 2020-12-04 06:34

I love the swipe pack thats inherited from embedding your views in a UINavigationController. Unfortunately i cannot seem to find a way to hide the Naviga

18条回答
  •  失恋的感觉
    2020-12-04 07:11

    Here is my solution: I am changing alpha on the navigation bar, but the navigation bar is not hidden. All my view controllers are a subclass of my BaseViewController, and there I have:

        override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        navigationController?.navigationBar.alpha = 0.0
    }
    

    You could also subclass UINavigationController and put that method there.

提交回复
热议问题