Open ShawnBaek opened 8 years ago
+1
Hiding tabBar can be done just by implementing scrollViewDelegate methods and animating the tabBar origin or frame with animation
//MARK: UIScrollViewDelegate
func scrollViewWillBeginDecelerating(scrollView: UIScrollView) {
if scrollView.panGestureRecognizer.translationInView(scrollView).y < 0 {
showHideTabBar(hidden: true, animated: true)
}
else {
showHideTabBar(hidden: false, animated: true)
}
}
func showHideTabBar(hidden hide: Bool, animated: Bool) {
var originY: CGFloat = 0
if hide {
originY = (self.view.frame.height)
} else {
originY = (self.view.frame.height) - 49
}
UIView.animateWithDuration(0.25, delay: 0, options: .CurveEaseIn, animations: {
self.tabBarController?.tabBar.frame.origin.y = originY
}, completion: nil)
}
I want hide only tabbar
is there a way to this feature?