Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can a navigation controller override a view controller?


Asked by Bridget English on Dec 08, 2021 FAQ



The default navigation item uses the view controller’s title, but you can override the navigationItem on a UIViewController subclass to gain complete control of the navigation bar’s content. A navigation controller automatically assigns itself as the delegate of its navigation bar object.
In this manner,
A navigation controller is a container view controller—that is, it embeds the content of other view controllers inside of itself. You access a navigation controller’s view from its view property.
Consequently, The Navigation Controller will automatically contain a Table View Controller, delete this and drag a View Controller to the storyboard. Ctrl + drag from the Navigation Controller to the View Controller and select the “root view controller” segue. Select the View Controller’s view and Go to the Attributes inspector.
Subsequently,
However, a view controller can ask that its view be displayed with a full-screen layout instead. In a full-screen layout, the content view is configured to underlap the navigation bar, status bar, and toolbar as appropriate.
Accordingly,
In the View Controller section check the "Is Initial View Controller" checkbox. The Navigation Controller will automatically contain a Table View Controller, delete this and drag a View Controller to the storyboard. Ctrl + drag from the Navigation Controller to the View Controller and select the “root view controller” segue.