   }
   
   func showTabBar() {
+    self.tabBar.layoutIfNeeded()
     self.tabBarBottom.constant = CGFloat(self.bottomPosition)
     
-    UIView.animateWithDuration(self.animationDuration, animations: { 
-      self.view.layoutIfNeeded()
+    UIView.animateWithDuration(self.animationDuration, animations: {
+      self.tabBar.setNeedsLayout()
+      self.tabBar.layoutIfNeeded()
       }) { (done) in
         if done {
           if !self.manualTransition {

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

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