     }
     
     if !self.swipeBackCancelled {
+      self.tabBar.layoutIfNeeded()
       let windowSize = self.view.frame.size.width
       let percent = Double(position) / Double(windowSize)
       let calculated = (self.tabBarHeight.constant * CGFloat(percent)) - self.tabBarHeight.constant
       self.tabBarBottom.constant = calculated
+      self.tabBar.layoutIfNeeded()
     }
   }
 }

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

  }
  
  func hideTabBarOnCancel() {
    self.tabBar.layoutIfNeeded()
    self.tabBarBottom.constant = -self.tabBarHeight.constant
    UIView.animateWithDuration(self.animationDuration, animations: {
      self.tabBar.setNeedsLayout()
      self.tabBar.layoutIfNeeded()
      })
    { (done) in
      if done {
