Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide tabbar only mode #46

Open
ShawnBaek opened this issue Aug 17, 2016 · 2 comments
Open

hide tabbar only mode #46

ShawnBaek opened this issue Aug 17, 2016 · 2 comments

Comments

@ShawnBaek
Copy link

I want hide only tabbar

is there a way to this feature?

@Joker666
Copy link

+1

@suhitp
Copy link

suhitp commented Sep 24, 2016

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)
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants