-4

I was doing gps location by using CLLocation. When i press submit button and start the process to get the coordinate. However the locationManager being called multiple times.

How can I get the value from last called in locationManager function ?

Thanks

user1219310
  • 732
  • 1
  • 9
  • 23
  • Possible duplicate of [Swift performance: sorting arrays](http://stackoverflow.com/questions/24101718/swift-performance-sorting-arrays) – NightSkyCode Jun 03 '16 at 18:23

1 Answers1

2

locationManager.location will give you the most recently retrieved location if it exists, otherwise the value will be nil.

Aaron
  • 6,466
  • 7
  • 37
  • 75