         
         let completion: (() -> Void) = {() -> Void in
             fromViewController.view.removeFromSuperview()
-            fromViewController.removeFromParentViewController()
-            toViewController.didMove(toParentViewController: self)
+            fromViewController.removeFromParent()
+            toViewController.didMove(toParent: self)
             if operation == .pushMainControllerFromLeft {
                 self.hideLeftView(animated: true)
             }

        let rvc: PBRevealViewController? = source as? PBRevealViewController
        let dvc: UIViewController? = destination
        if (identifier == PBSegueMainIdentifier) {
            rvc?.addChildViewController(dvc!)
            dvc?.didMove(toParentViewController: rvc)
            rvc?.mainViewController = dvc
        }
        else if (identifier == PBSegueLeftIdentifier) {
            rvc?.addChildViewController(dvc!)
            dvc?.didMove(toParentViewController: rvc)
            rvc?.leftViewController = dvc
        }
        else if (identifier == PBSegueRightIdentifier) {
            rvc?.addChildViewController(dvc!)
            dvc?.didMove(toParentViewController: rvc)
            rvc?.rightViewController = dvc
        }
        

                    }
                #endif
                self.leftViewController?.view.removeFromSuperview()
                self.leftViewController?.willMove(toParent: nil)
                self.leftViewController?.removeFromParent()
                #if os(tvOS)
                    self.setNeedsFocusUpdate()
                    self.updateFocusIfNeeded()
