Below is my code to placing an annotation on a Map View. I'm getting a "unexpectedly found nil while unwrapping optional value error". I do not know why my annotation value is giving a nil value.
import UIKit
import MapKit
class MapViewcontroller: UIViewController {
var itemStore: ItemStore!
@IBOutlet weak var mapView: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
print("test")
let annotation = MKPointAnnotation()
annotation.coordinate = CLLocationCoordinate2D(latitude: 40.71304, longitude: -74.0072)
annotation.title = "Test"
self.mapView.addAnnotation(annotation) //error here
}