We have implemented swipe to delete with confirmation introduced in iOS15 and now when we start showing confirmation Dialog in iOS16.1 Beta 4, the app crashes apparently when internally [UISwipeOccurrence _executeLifecycleForPerformedAction:sourceView:completionHandler:] is
called.
Here is the code simplified:
List {
ForEach(items, id: \.self) { item in
ItemView(item: item)
.swipeActions {
Button(role: .destructive) {
itemToDelete = item
showDeleteConfirmation = true
} label: {
Image(systemName: "trash")
}
}
}
}
.confirmationDialog(deleteConfirmationTitle,
isPresented: $showDeleteConfirmation,
titleVisibility: .visible) {
Button(role: .destructive) {
if let itemToDelete {
withAnimation {
model.delete(itemToDelete)
}
}
} label: {
Text("Delete")
}
Button(role: .cancel) {
} label: {
Text("Cancel")
}
}
Appreciate any ideas and feedback.