user2722667
user2722667

Reputation: 8651

swift xcode proper way to switch from navigation controller to tab bar controller

I have embedded a navigation controller like this:

enter image description here

I have also set this to be my root view with the arrow in storyboard pointing to this. But now I want to change so my app use a tab bar instead of a navigation controller. I have tried to click on the navigation controller than add a tab bar controller. But when I search through my storyboard xml file I still see refrences to navigation controller

Upvotes: 0

Views: 365

Answers (1)

vacawama
vacawama

Reputation: 154523

To replace the NavigationController with a TabBarController:

  1. Select the NavigationController in the Storyboard.
  2. Hit the delete key.
  3. Select your ViewController.
  4. Select Editor->Embed in->Tab Bar Controller from the menu.
  5. Select the TabBarController and check Is Initial View Controller in the Attributes Inspector.

Upvotes: 1

Related Questions