   
   func hideTabBar() {
     self.tabBarBottom.constant = -self.tabBarHeight.constant
-    UIView.animateWithDuration(self.animationDuration) {
+    UIView.animateWithDuration(self.animationDuration, animations: {
       self.view.layoutIfNeeded()
+    }) { (done) in
+      if done {
+        self.tabBarVisible = false
+      }
     }
   }
   

  }
  
  func calculateTabBarPosition(position: Int) {
    if position <= 0 {
      self.swipeBackCancelled = true
      self.hideTabBarOnCancel()

    
    if var hasSwipeBack = self.destinationVC as? SwipeBackPositionProtocol {
      hasSwipeBack.positionClosure = { position in
        if let nav = hasSwipeBack as? UINavigationController, let previousVC = nav.viewControllers.last as? TabBarVisibilityProtocol {
          if previousVC.isVisible && !self.tabBarVisible {
            self.calculateTabBarPosition(position)
          }
        }
      }
    }
    
