I have view controller with tableview when i scroll tableview i want to hide tab bar in view controller. i have tried below code its working but top label went minus position of origin Y
extension UITabBarController {
func setTabBarVisible(visible:Bool, duration: TimeInterval, animated:Bool) {
if (tabBarIsVisible() == visible) { return }
let frame = self.tabBar.frame
let height = frame.size.height
let offsetY = (visible ? -height : height)
// animation
if #available(iOS 10.0, *) {
UIViewPropertyAnimator(duration: duration, curve: .linear) {
self.tabBar.frame.offsetBy(dx:0, …Run Code Online (Sandbox Code Playgroud)