Thanks for the reply Rico. I watched the talk Use SwiftUI with UIKit several times and tried the sample too.
Maybe with an image I can make myself clear:
After a selection the user can click the button which means Accept Bid then an Alert is displayed
If Aceito! is chosen it means that the equipment is no longer for sale and the row must be removed from the LancesTableView.
CheckBoxUIView(showContent: ShowContent(false, buttons: buttons[indexPath.row], oferta: offers[indexPath.row] )) // accepted
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
Button(role: .destructive) { [weak self] in
guard let indexPath = self?.tableView.indexPath(for: cell) else {
return}
self!.buttons.remove(at: indexPath.row)
self?.offers.remove(at: indexPath.row)
self!.tableView.deleteRows(at: [indexPath], with: .automatic)
self!.showAlert(title: "Deleted", message: "***** ", row: indexPath.row)
} label: {
Label("Delete", systemImage: "trash")
}
If swipeAction is used like the code above shows I can get the UI effect I need but the Alert is inside the cell.
How can I make a trigger action coming from the SwiftUI cell's Alert to call a function from the tableView controller so that the tableview's row can be updated/deleted?