I am developing an iOS application using Xcode 7.2 and Swift 2.1, and I have successfully implemented the MapKit map in my application. The map loads perfectly and focuses on the user's current location.
Now I want to get the coordinates of the center if the user moves the center of the map to a new location. These new location coordinates will be "captured" with the click of a button (see the "Set Grid" button in the attached gif) and displayed on the label.
Move from A to B and set new center coordinates
The closest I came to the answer here , and I implemented this code, but I still can’t figure out how to update the shortcut with coordinates by clicking the IBOutlet button that I created.
What am I missing here ?!
Any help would be greatly appreciated - thanks in advance!
---------------- NEXT QUESTION ------------------
Now that we have solved the problem, and we have a shortcut filled with the new coordinates of the center, I have one more question - most likely, the supervision of the nob, but I'm on a steep learning curve here, so please ...
We successfully determined the coordinates of the center, and now they were set as mapLongitude and mapLatitude inside the function we created.
I have two other variables ( newTargetLong and newTargetLat ) that make up part of the array of values that will be passed to the next view controller, and I want
let newTargetLong = mapLongitude
let newTargetLat = mapLatitude
.append.
- "" . ?