Navigation Tab Bar in IOS | Swift tutorial

Different Customizing techniques for Navigation bar with storyboard and code

1) Custom NavigationTabBar by StoryBoard

1.1) Add navigation bar directly by storyboard and Add single navigation bar button
  • Set property Top bar : – Select the viewController and change the property of Tab bar to Trnaslucent Navigation Bar.
  • Add navigation title view:: – Add Navigation item in navigation bar. (Directly drag and drop)
  • Navigation bar Button : – Directly drag and drop the Bar Button Item in navigation bar. According to your requirement.
  • Bar button properties : – Set directly navigation bar button item image by storyboard and chnage the bar button tint color according to you.

Get Action action for these navigation bar:- directly create action methods for these navigation bar button item

1.2) Add multiple navigation bar button Directly by storyboard (Custom Navigation bar button item)
  • Follow the same 1.1 process for adding the navigaiton bar in UIViewController.
  • Now you can add multiple button with storyboard, directly drag and drop from Show The Object Libary tab.
1.3) Add Custom multiple navigation bar button Directly by storyboard (Add UIButton in navigation bar button item)

NOTE: – We Can add custom UIView in navigation bar item accroding to requirement

  • Add UIView In bar button item : – For adding the UIButton in navigation bar, First we need to add UIView in Navigation bar item. We can directly drag and drop add UIView in nav item.
  • Chnage UIView dimension : – We can change the UIView Dimension by change the view height and width.
  • Add Custom UIButton or custom design in UIView : – NOw we can directly add the UIBUtton or custom design accroding you requirement.
1.4) Add Navigation Prompt by Storyboard
  • Directly set the Navigation Promt by navigation bar Properties.
1.5) Add Custom title view in Navigation bar
  • Add Custom title view : We can directly drag and drop the UIView in title view and change the dimrntion by change the height and width in UIView properties.

2) Custom Navigation bar with Code in view Controller

2.2) Navigation Right Bar button
  • Add UIBarButtonItem : – Create UIBarButton item and assign them to rightBarButtonItem.

  • Add Image : – Create UIBarButtonItem With Image.

  • Add Custom View : – Create UIBarButtonItem with custom view

2.2) Custom title view

Assign View in navigationItem titleView. And set the frame for view.

2.3) Navigation Prompt

2.4) Large Title View

Large title view is coming in iOS 11

2.5) Multiple UIBarButtonItem in navigation right bar

Add array of UIBarButtonItem in naviaitionItem property rightBarButtonItems




Download the complete project here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.