IOS TOPICS

IOS Introduction
Swift UI Label
Swift UI Button
Swift UI Text Field
Swift UI Slider
Swift UI Switch
Swift UI Stepper
Swift UI Date Picker
Swift UI Segmented Control
Views
Table View
Collection Views
SCROLL VIEW
iOS Content View
iOS View Controllers
iOS Bar interface
iOS Navigation interface
iOS Architect Pattern
iOS Libraries
iOS Web request and parsing
iOS user defaults
iOS Coredata and database

Navigation Bar


Navigation Bar

In combination with the navigation controller displayed at the top of the screen, the navigation bar is employed. The case inherited by UIView is the UINavigationBar class.

The UINavigationBar object is a bar shown at the top of the view controller window, integrated with the Navigation Controller. A navigation bar usually includes bar-button items needed to navigate the hierarchy of screens. A conventional Navigation bar has a left-hand button, the center View Controller title and the right-hand button.

In combination with the UINavigationController object, the most popular navigation bar is used. The navigation controller develops and manages the navigation bar linked with it. The contents of the navigation bar are also monitored by using the view controller properties.

The following actions are necessary to adjust the navigation bar's aspect using a navigation controller.

  1. Enter or construct your display controller by instantiating your UINavigationController class in the navigation controller.
  2. Use the navigation bar property on the UINavigationController object to get the related navigation bar.
  3. Check the Navigation Bar contents by setting title and navigationItem on each UIViewController pointed to the browser stack.

Use standalone bar of navigation

A navigation bar can also be used without a navigation control. We must look for UINavigationBar in the object library to use a navigation bar and drag the outcome to our View controller. The following actions must be taken to configure the appearance of the stand-alone UINavigationBar.

  1. Set the auto-layout rules to regulate the position and size of the interface navigation bar.
  2. To provide the initial title, create a root navigation element.
  3. To handle user interactions with the navigation bar, configure the delegated object.
  4. Adjust the Navigation Bar appearance.
  5. To push and pop the suitable navigation application configure.

NavigationBar Appearance configuration

The UINavigationBar barStyle feature is used to set the bar style. In general, there are two looks: black or default on the navigation bar. The black style makes the black background navigation bar and the white text. We can also configure it to make it semicircular. The table below shows interface builder attributes used for the navigation bar configuration.