Im following a tutorial on how to work with MapKit and I am having trouble getting past the first few steps of the tutorial. I have checked other tutorials and they all have the exact same initial steps.
But I get a warning that ViewController is part of module Mapkit and ignoring MapKit
And then I get an error: use of undeclared type MKMapView - which is most likely caused by MapKit not being imported.
Here's a screen shot of the errors and the code:

I believe I am following the tutorial steps correctly.
Any idea whats Im doing wrong?
My guess here is that you called your application MapKit and you are seeing a collision with the actual MapKit framework because the modules have the same name.
Either:
or
Try this, it worked for me.
import UIKit
import MapKit
class ViewController: UIViewController {
@IBOutlet weak var map: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
}
}
Apart of the weak reference and the syntax issues I would suggest you to check your Project name - the name might clashes with the iOS library! This issue happened to me in the past - check this out If it doesn't work for you let me know
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With