OneShotLocationManager
OneShotLocationManager copied to clipboard
Not working on NSLocationAlwaysUsageDescription of plist
I simply put the following in my viewWillAppear, and it prints nothing
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
}
BTW, I do it in simulator and give a virtual location, anything wrong with it?
I found I should set NSLocationWhenInUseUsageDescription in plist. If only NSLocationAlwaysUsageDescription, it doesn't work.
I just created a pull request for this issue
https://github.com/icanzilb/OneShotLocationManager/pull/6