The specified root controller is not a valid controller type. code example
Example: swift go to root view controller
// For Navigation
self.navigationController?.popToRootViewController(animated: true)
// For Presenting modally
self.view.window!.rootViewController?.dismissViewControllerAnimated(false, completion: nil)