就是这样完成的:// example ViewController let myVC = UIViewController() // create the NavigationController with my VC as root let navCon = UINavigationController(rootViewController: myVC)