100 Days of SwiftUI
2026-07-23
Project 14, part 3
All about Maps
Adding user locations to a map
We need to use onTapGesture because it’s a map, but in general for accessibility a button is preferred
TapGesturereports position in screen coordinates, so need to addMapReaderto get map coordinates- does not interfere with other map gestures
Improving our map annotations
You can wrap example data used for XCode views in
# if DEBUG
static let example = ...
# endifand it won’t be compiled into the final app code
Selecting and editing map annotations
LongPressGesture on one of the existing locations is good for going into some sort of “edit” sheet

