Creating a MapView the first time

Greeting fellow programmers, I’m farirly new to IOS developing/programming, and going into third week working through the book. The issue I am having is directly after the book ask you to delete the Map view controller from the storyboard and create it through code. I’ve entered in the code for the map view, but when you run the application the only view that is displayed is the convert tab, and I am unable to toggle the map view at this time. Any insight into the issue is welcome and thank you in advance.

import UIKit
import MapKit

class MapViewController: UIViewController {

var mapView: MKMapView!

override func loadView() {
    //create a map view
    mapView = MKMapView()
    
    //set it as *the* view of this View controller
    view = mapView
}




override func viewDidLoad() {
    super.viewDidLoad()
    
    print("MapviewController loaded it's view")
}

}

Show us your code: all of it, including the creation of the MapViewController instance itself.

Hello Ibex10, I’m not sure what I’m not including when you say " including the MapViewController instance itself". does Class MapViewController: UIViewController not create an instance of MapViewController, or did I miss that step? Thanks in advance

After redoing part of chapter 4 up to chapter 5, I figured out what the issue was. The book is calling for deleting the Map View specifically, and not the whole MapViewController label added in the pervious chapter. So my swift file I’m assuming had nothing to reference since the actually controller was deleted from the project.