Replace rootViewController behind a modal view
<p>With the following code I'm able to change the <code>rootViewController</code> behind a modal view :</p>

<pre><code>let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let signupVC = storyboard.instantiateViewControllerWithIdentifier("SignupNavigationController") as! UINavigationController
let landingPageVC = storyboard.instantiateViewControllerWithIdentifier("LandingPage") as! LandingPageViewController

presentViewController(signupVC, animated: true, completion: {
   UIApplication.sharedApplication().delegate?.window??.rootViewController = landingPageVC
   UIApplication.sharedApplication().delegate?.window??.sendSubviewToBack(landingPageVC.view)
})
</code></pre>

<p>When I close my modal view controller it's the previous rootViewController that is displayed (only during the animation). Then my new view controller is displayed properly. </p>

<p>Any idea how I could prevent this ? </p>