Adds an import view that shows when the app is opening a .monster file.

This commit is contained in:
2021-04-04 01:18:00 -07:00
parent 9076f5896d
commit 6eca7efb0c

View File

@@ -10,6 +10,7 @@ import CoreData
struct ContentView: View { struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext @Environment(\.managedObjectContext) private var viewContext
@State private var isShowingImportDialog = false
var body: some View { var body: some View {
TabView { TabView {
@@ -35,6 +36,14 @@ struct ContentView: View {
Text("Library") Text("Library")
} }
} }
.onOpenURL(perform: beginImportingMonster)
.sheet(isPresented: self.$isShowingImportDialog) {
Text("Importing Monster")
}
}
func beginImportingMonster(url: URL) {
self.isShowingImportDialog = true
} }
} }