OneShotLocationManager
OneShotLocationManager copied to clipboard
Cannot fetch the new location, only first time
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?