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 7022739c55
commit f8b6c1c45c

View File

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