X-Git-Url: https://git.r.bdr.sh/rbdr/map/blobdiff_plain/5e8ff4850c4827125fe12788dd5b153c4f636f48..91fd86189477e6c690c6487d51d80bc58c8ecb63:/Map/Views/ContentView.swift diff --git a/Map/Views/ContentView.swift b/Map/Views/ContentView.swift index 4f55c27..f439026 100644 --- a/Map/Views/ContentView.swift +++ b/Map/Views/ContentView.swift @@ -11,6 +11,8 @@ import SwiftUI struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext + @EnvironmentObject var store: AppStore + @FetchRequest( sortDescriptors: [NSSortDescriptor(keyPath: \Map.createdAt, ascending: true)], animation: .default) @@ -35,6 +37,11 @@ struct ContentView: View { .foregroundColor(Color.black) .cornerRadius(2.0) }.padding(.leading, 8.0) + }.contextMenu { + Button(action: { store.send(.deleteMap(map: map))}) { + Image(systemName: "trash") + Text("Delete") + } } } .onDelete(perform: deleteMaps) @@ -49,6 +56,7 @@ struct ContentView: View { } } } + DefaultMapView() } }