I'm presenting a List inside a modal. If I'm inside a NavigationView the EditButton its totally broken.
struct ContentView: View {
@State var showSheetView = false
var body: some View {
NavigationView {
Button(action: {
self.showSheetView.toggle()
}) {
Image(systemName: "bell.circle.fill")
.font(Font.system(.title))
}
.sheet(isPresented: $showSheetView) {
SheetView()
}
}
}
}
struct SheetView: View {
@State private var myArray: [String] = ["One", "Two", "Three"]
var body: some View {
NavigationView {
VStack {
List {
ForEach(myArray, id: \.self) { item in
Text(item)
}.onDelete(perform: { indexSet in
})
}
}
.navigationBarItems(trailing: EditButton())
}
}
}
If I remove the NavigationView where i present from, then at first it seems to work, the second time i present it gets broken again.
struct ContentView: View {
@State var showSheetView = false
var body: some View {
Button(action: {
self.showSheetView.toggle()
}) {
Image(systemName: "bell.circle.fill")
.font(Font.system(.title))
}
.sheet(isPresented: $showSheetView) {
SheetView()
}
}
}


