OneShotLocationManager icon indicating copy to clipboard operation
OneShotLocationManager copied to clipboard

After disable the location services manually and enable it again after some times location issue

Open vinod1988 opened this issue 10 years ago • 0 comments

After disable the location services manually and enable it again after some times the locationmanager fetchWithCompletion method not calling.

    self.locationManager = OneShotLocationManager()
    self.locationManager!.fetchWithCompletion {location, error in

        // fetch location or an error
        if let loc = location {
            print(loc.description)

            let latNum:NSNumber = (location?.coordinate.latitude)!
            let lngNum:NSNumber = (location?.coordinate.longitude)!


        } else if let err = error {
            print(err.localizedDescription)
        }

        // destroy the object immediately to save memory
        self.locationManager = nil
    }

I think always check the location services wheather enable or diable it based on that call the fetchWithCompletion block.

vinod1988 avatar Nov 14 '15 16:11 vinod1988