App Crashing with MapKit

I've been trying to add a MapKit to my app where you can see a location on the map. I'm not trying to do anything special. I just wanted the map to automatically show you where I want it to be. I've added the following code below, but every time that I run the app it will crash and give me the error Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0X0) on line 10. I've tried everything and nothing seems to be working. What can I do?

import MapKit

class ViewController: UIViewController, MKMapViewDelegate {

    @IBOutlet weak var mapView: MKMapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        mapView.delegate = self
        let mexico = MKCoordinateRegionMake(CLLocationCoordinate2DMake(20.648097, -105.235168), MKCoordinateSpanMake(0.01, 0.01))
        mapView.setRegion(mexico, animated: true)
    }

If it helps, I'm running the latest version of Swift and Xcode.

Sounds like your mapView outlet is not connected. Have you added a map view on the storyboard and control-dragged to the @IBOutlet declaration to connect the outlet?

I get the same error that my app crashed with the "Thread 1" except that I am using a button to launch a map. The map launches successfully but my app is frozen. What is the fix for that?

App Crashing with MapKit
 
 
Q