Owl icon indicating copy to clipboard operation
Owl copied to clipboard

Proper handling of willSelectRowAt

Open dmarcato opened this issue 5 years ago • 0 comments

Currently the library is not properly handling willSelectRowAt since there is noway to have it return nil (in case you want to prevent a row from being selected). The root of the issue is the Nil-coalescing operation in this line:

return (adapter.dispatchEvent(.willSelect, model: model, cell: nil, path: indexPath, params: nil) as? IndexPath) ?? indexPath

I thought about just removing it, but instead decided to use an approach similar to what you did with TableAdapterCellAction - thoughts?

P.S.: also made willDeselectRowAt consistent to willSelectRowAt, and changed the return type of didDeselect to Void (since it's not used anyway).

dmarcato avatar Jul 17 '19 03:07 dmarcato