I want to create : show view without Navigation Bar, and when I scrolling if distance from top >= 100 height and to the bottom show Navigation Bar.
When scroll from bottom : if distance to top <= 100 height need to hideNavigation Bar Im try this, but it did not help me
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { if(velocity.y>0) { UIView.animate(withDuration: 2.5, delay: 0, options: UIViewAnimationOptions(), animations: { self.navigationController?.setNavigationBarHidden(true, animated: true) }, completion: nil) } else { UIView.animate(withDuration: 2.5, delay: 0, options: UIViewAnimationOptions(), animations: { self.navigationController?.setNavigationBarHidden(false, animated: true) }, completion: nil) } }