             toViewController.didMoveToParentViewController(self)
             
             // set the current view controller
-            self.currentRootViewController = toViewController
+            currentRootViewController = toViewController
+            
+            // update status bar appearance
+            setNeedsStatusBarAppearanceUpdate()
             
             // completion handler
             completion?()

        }
        
        // add the new controller as a child
        self.addChildViewController(toViewController)
        toViewController.view.frame = self.view.bounds
        self.view.addSubview(toViewController.view)
        
        // if there is a current view controller, transition from it to the new one
        if self.currentRootViewController != nil {
            self.currentRootViewController?.willMoveToParentViewController(nil)
            
            // perform the transition
            let d = animated ? 0.65 : 0.0;
            
            self.transitionFromViewController(self.currentRootViewController!, toViewController: toViewController, duration: d, options: .TransitionCrossDissolve, animations: nil) { finished in
                // "decontain" the old child view controller
                self.currentRootViewController?.view.removeFromSuperview()
                self.currentRootViewController?.removeFromParentViewController()
                
                // set the new current view controller and finish "containing" it
                self.currentRootViewController = toViewController
                toViewController.didMoveToParentViewController(self)
                
                // completion handler

public class AppViewController: UIViewController {
    
    /// Returns the view controller that is currently installed.
    public var installedViewController: UIViewController? { return self.currentRootViewController }
    
    /// Internal reference to the installed view controller
    private var currentRootViewController: UIViewController?
    
    /**
     Transitions from the currently installed view controller to the specified view controller. If no view controller is installed, then this method simply loads the specified view controller.
     - parameter toViewController: The view controller to transition to.
     - parameter animated: true if the transition should be animated, false otherwise.
     - parameter completion: A block to be executed after the transition completes.
