Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull out latitude/longitude coordinates from MKMapItem

I'm creating an app that uses CoreData to store points of interest. MKMapItem coordinates are accessible within mapItem.placemark.location. I'd like to pull out the individual latitude and longitude coordinates and store them in a managedObjectContext as doubles. How would I do that?

like image 432
Adrian Avatar asked Mar 13 '15 14:03

Adrian


1 Answers

For every easy question, there's an easy answer:

mapItem.placemark.location.coordinate.latitude
mapItem.placemark.location.coordinate.longitude
like image 81
Adrian Avatar answered Nov 10 '22 16:11

Adrian