Creating a UINavigationController programmatically
Creating a UINavigationController programmatically is trivial.
Assuming that you’ve already created a class called RootViewController
that subclasses UIViewController, you would use something like this,
typically in your AppDelegate file: