OneShotLocationManager icon indicating copy to clipboard operation
OneShotLocationManager copied to clipboard

Cannot fetch the new location, only first time

Open jamesweb1 opened this issue 9 years ago • 0 comments

For simplified the issue, I put the following code in viewWillAppear so that it re-fetch the location each time entering into this page:

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

            // fetch location or an error
            if let loc = location {
                println(location)
            } else if let err = error {
                println(err.localizedDescription)
            }
            self.manager = nil
        }

It's really strange it can only fetch the first location in simulator, and it's still in the first position when I change to another location. I see the source code, I think deinit the manager should start over again, doesn't it?

jamesweb1 avatar Jun 16 '15 09:06 jamesweb1