I learn Swift 3 myself, and my current training project assumes that the user can click a photo and get a map snapshot with the current location pinned.
I have relied on this answer since August 2015 and this answer since June 2016 for guidance, but I still cannot find the right path.
Now I can ...
- Get photo from clipboard
- Get a map snapshot
But I just can't put a pin. I know that my code is incomplete and inefficient - so this is not just a debugging issue. Here's what I worked for (like many of the options based on the links above):
let snapShotter = MKMapSnapshotter(options: mapSnapshotOptions) snapShotter.start() { snapshot, error in guard let snapshot = snapshot else { return } let image = snapshot.image let annotation = MKPointAnnotation() annotation.coordinate = needleLocation
I was stuck for a few days, so of course I would appreciate any ideas. Thanks!
source share