SwiftUI List rows in Edit Mode do not allow Buttons actions to work I note (as well as NavigationLinks too). Is there a way to get this working?
Goal - Want to have NavigationLink or Modal view to the following depending on the edit mode. This relies on the ability to have button actions/nav links working in Edit Mode. (if there's another way to achieve my goal happy to have pointers)
Code (just to highlight the button doesn't work in Edit Mode):
List() {
ForEach(gcLists) { gcList in
HStack {
Button(gcList.title) {
print("button pressed!")
}
}
}
.onDelete(perform: deleteList)
.onMove(perform: move)
}
I used previously the following approach, please try
Button(action: {}) {
// label content here
}
.onTapGesture {
// action here
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With