Learn Courses My Dashboard

Xcode ignores error in MapKit

Hello, i have a mini code:

import UIKit
import MapKit

class ViewController: UIViewController {
var locMgr = CLLocationManager()
var mapView = MKMapView()

CLLocationManager is not part of MapKit Framework. But anyway there is no error.

fyi: CLLocationManager is part of CoreLocation Framework.

I don´t understand how that works.

did you perhaps had/imported it before? there might be residual files in the app cache that makes it “find” the CoreLocation framework

try cleaning your project it should produce the error

How i clean?

If you google how to clean your Xcode project

You’ll find it’s Cmd + Shift + K

I have cleaned my project. Nothing changed.
How CLLocationManager can be part of MapKit? I don´t understand this.