I want to present a UINavigationController
modally however, I want to present the second controller within that stack rather than the root. How can this be done?
UINavigationController
provides a method setViewControllers(_:animated:)
and with its help you can configure the navigation stack the way you want.
let navigationController = UINavigationController()
navigationController.setViewControllers([rootViewController, secondViewController], animated: false)
self.present(navigationController, animated: true)