0

I am working my way through the iOS Big Nerd Ranch book, and have hit a roadblock. This is about the extent of my iOS knowledge. I found a similar question from a few years back, but was not able to implement the solution so maybe my case is different: Programmatically assign view controller to tab bar controller

The Problem: The book has you delete a storyboard controller in order to implement it programmatically. Currently the app is two viewControllers and a Tab Bar Controller to navigate between the two. I deleted the viewController and implemented it in swift according to directions (pictured below), but I am not sure how to link this MapViewController back up with the Tab Bar Controller. Referencing storyboard objects programmatically has not been discussed yet, and I am having trouble piecing the steps together from other online resources.

What Happens When I Run It: My application opens up to the other viewController, which is a storyboard, and the Tab Bar Controller only contains a button for that one viewController.

The Question: What is the appropriate way (where should it be done, and how) to take the viewController I have defined in swift below, and place it in the Tab Bar Controller? Thank you very much for the help!

The storyboard with the MapViewController deleted:

The MapViewController that I want to put in the Tab Bar Controller:

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257

0 Answers0