viewWillAppear/DidAppear called twice when changing rootViewController with an Animation
<p>Here is the code of my animation/transition : </p>

<pre><code>if let window = self.window where animated {
   window.rootViewController?.dismissViewControllerAnimated(true, completion: {
       UIView.transitionFromView(window.rootViewController!.view, toView: tabBarController.view, duration: 0.8, options: .TransitionFlipFromLeft, completion: { _ in
           window.rootViewController = tabBarController
       })
   })
}
</code></pre>

<p>Without the animation code, (just setting the <code>rootViewControlller</code>), the problem does not appear. </p>

<p>Any idea why it makes the view appear twice and how I could fix this ? </p>