tristanhimmelman / HidingNavigationBar

Easily hide and show a view controller's navigation bar (and tab bar) as a user scrolls
MIT License
1.03k stars 128 forks source link

all what we have to do is the following instead of using a pod #83

Open AymanOmara opened 2 years ago

AymanOmara commented 2 years ago
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
    let translation = scrollView.panGestureRecognizer.translation(in: scrollView.superview)
    if(translation.y > 0){
        self.navigationController?.setNavigationBarHidden(false, animated: true)
    }else{
        self.navigationController?.setNavigationBarHidden(true, animated: true)
    }

}
mrmatil commented 1 year ago

Yeah, especially when we for ex. have to implement tabbar hiding and complex animation for it. Useless issue