简体   繁体   中英

iOS Swift - CoreLocation coordinates

I'm building an app that uses CoreLocation to get user's coordinates. After I start updating location, I'll get the coordinates in didUpdateLocations. Probably because of gps calibration, in didUpdateLocations I get 2 or 3 different coordinates, until it stops. How can I call a function after updating locations has stopped that uses the last founded coordinates?

Allow didUpdateLocations: to be called repeatedly, as you rightly say, until either you hit some kind of timeout or your get sufficient horizontal accuracy. Then, right from didUpdateLocations: , tell the location manager to stop, and call the function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM