diff options
Diffstat (limited to 'Map/MapDetail.swift')
| -rw-r--r-- | Map/MapDetail.swift | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/Map/MapDetail.swift b/Map/MapDetail.swift deleted file mode 100644 index 74e3c8d..0000000 --- a/Map/MapDetail.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// ContentView.swift -// Map -// -// Created by Ruben Beltran del Rio on 2/1/21. -// - -import SwiftUI -import CoreData - -struct MapDetailView: View { - @Environment(\.managedObjectContext) private var viewContext - - @ObservedObject var map: Map - - @State private var selectedEvolution = StageType.General - - var body: some View { - VSplitView { - VStack { - TextField("Title", text: Binding($map.title, ""), onCommit: { - try? viewContext.save() - }) - Picker("Evolution", selection: $selectedEvolution) { - ForEach(StageType.allCases) { stage in - Text(Stage.title(stage)).tag(stage) - } - } - TextEditor(text: Binding($map.content, "")).onChange(of: map.content) { _ in - try? viewContext.save() - }.font(Font.system(size: 16, design: .monospaced)) - } - ScrollView([.horizontal, .vertical]) { - MapRenderView(map: map, evolution: Stage.stages(selectedEvolution)) - } - } - } -} - -struct MapDetailView_Previews: PreviewProvider { - static var previews: some View { - MapDetailView(map: Map()).environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) - } -} |