Adds an import view that shows when the app is opening a .monster file.
This commit is contained in:
@@ -10,6 +10,7 @@ import CoreData
|
||||
|
||||
struct ContentView: View {
|
||||
@Environment(\.managedObjectContext) private var viewContext
|
||||
@State private var isShowingImportDialog = false
|
||||
|
||||
var body: some View {
|
||||
TabView {
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user