struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
+ @EnvironmentObject var store: AppStore
+
@FetchRequest(
sortDescriptors: [NSSortDescriptor(keyPath: \Map.createdAt, ascending: true)],
animation: .default)
.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)
}
}
}
+ DefaultMapView()
}
}