title: CLLocationManagerDelegate Singleton
body: <p>I'm trying to create a <code>CLLocationManager</code> Singleton with this interface only <code>Location.start()</code> on <code>ViewController</code> but I don't see any location updates with this structure.<br> I am using <code>print(mostRecentLocation)</code> to detect a location update. <br> How can I fix this? </p>
  
  <p>Here is my code in <code>Location.swift</code>:</p>
  
  <pre><code>import CoreLocation
  
  class Location: NSObject, CLLocationManagerDelegate {
      private static var locationManager: CLLocationManager = {
          var manager = CLLocationManager()
          manager.desiredAccuracy = kCLLocationAccuracyBest
          return manager
      }()
  
      static func start() {
          locationManager.requestAlwaysAuthorization()
          locationManager.startUpdatingLocation()
      }
  
      func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
          guard let mostRecentLocation = locations.last else {
            return
          }
  
          print(mostRecentLocation)
      }
  }
  </code></pre>
  
  <p>And on <code>ViewController.swift</code></p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      Location.start()
  }
  </code></pre>
  
  <p>I see this <a href="https://github.com/igroomgrim/CLLocationManager-Singleton-in-Swift" rel="nofollow noreferrer">https://github.com/igroomgrim/CLLocationManager-Singleton-in-Swift</a> <br> and this <a href="https://github.com/irfanlone/CLLocationManager-Singleton-Swift" rel="nofollow noreferrer">https://github.com/irfanlone/CLLocationManager-Singleton-Swift</a> <br> but I don't like the interface.</p>