Learning Time : 1h 15min

My Github : Bucket List Source Code

My Note index link

day70.png

KeyWords

Adding user locations to a map

Set up the map view

import MapKit

struct ContentView: View {
    @State private var mapRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 50, longitude: 0), span: MKCoordinateSpan(latitudeDelta: 25, longitudeDelta: 25))

    var body: some View {
        ZStack {
            Map(coordinateRegion: $mapRegion)
                .ignoresSafeArea()
            Circle()
                .fill(Color.blue.opacity(0.3))
                .frame(width: 32, height: 32)
        }
    }
}

Add a button for adding locations