Reputation: 156
I have a function in my CllocationManagerDelegate
which I need to execute after my CllocationManager
updates the location as soon as possible, but definitely not before. Is there any way to have a block of code execute as soon as the CllocationManager
updates the location?
Upvotes: 0
Views: 67
Reputation: 151
I would call your method, in the protocol method didUpdateLocations.
Like this:
func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
// update any CLLocation values
// And then call the method with the code that you need to execute ASAP
self.yourMethod()
}
Hope this helps!
Upvotes: 1