Hi there. Just wondering whether the behaviour I'm running into working with table views is a bug or I'm missing something in my implementation.
I have an app where I want to selectively apply custom row actions, where an Undo action will only appear for cells who have had their values modified today.
Rough code from the editActionsForRowAtIndexPath method follows:
if amt > 0 {
let undo = UITableViewRowAction(style: .Normal, title: "Undo", handler: { action, index in
// stuff happens here
})
return [undo]
} else {
return []
}What happens is that if I swipe on one of the cells that should be valid (i.e. amt > 0) the Undo action correctly shows up. When I swipe on a row where the value of amt is equal to 0, it correctly shows no Undo action (small "bounce" one the swipe action but no options). From then on, the swipe action fails to work on any of the table rows until I reload the app, with not even the small bounce which I see initially for rows for which Undo should not be an option.