title: UITabBar show black screen when use animated transition. (swift)
body: <p>I'm making iOS UITabBar application and I try to using animate transition. But there is something wrong. My app show black blank view when change view with animated transition.</p>
  
  <p>My some code</p>
  
  <p>class TransitionManager</p>
  
  <pre><code>...
  func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
  
      let container = transitionContext.containerView()
      let fromView = transitionContext.viewForKey(UITransitionContextFromViewKey)!
      let toView = transitionContext.viewForKey(UITransitionContextToViewKey)!
  
      let offScreenRight = CGAffineTransformMakeTranslation(container.frame.width, 0)
      let offScreenLeft = CGAffineTransformMakeTranslation(-container.frame.width, 0)
  
      toView.transform = offScreenRight
  
      container.addSubview(toView)
      container.addSubview(fromView)
  
      let duration = self.transitionDuration(transitionContext)
  
      UIView.animateWithDuration(duration, delay: 0.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.8, options: nil, animations: {
  
          fromView.transform = offScreenLeft
          toView.transform = CGAffineTransformIdentity
  
          }, completion: { finished in
              transitionContext.completeTransition(true)
      })
  
  }
  ...
  </code></pre>
  
  <p>UITabBarController</p>
  
  <pre><code>func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -&gt; UIViewControllerAnimatedTransitioning? {
      var animatedTransitioningObject = TransitionManager()
      return animatedTransitioningObject
  }
  </code></pre>
  
  <p>I will try to add this code when transition complete</p>
  
  <pre><code>    }, completion: { finished in
          transitionContext.completeTransition(true)
          // add this line
          UIApplication.sharedApplication().keyWindow!.addSubview(toView)
  })
  </code></pre>
  
  <p>Now my second view are show correctly, But my tabbar are disappear!
  I'm try to debug view hierarchy. It seem my tab bar isn't disappear. But It bring to back of second view.</p>
  
  <p>How to fix this problem ?</p>
  
  <p>ps. sorry for my bad english.</p>