#Common UseCases
The effect is similar to using tableView(_:didSelectRowAt:)
method on UITableViewDelegate
. You need to do few steps to be able to react on tapping on a cell.
BentoKit
has a class namedInteractiveView
. Your component's view needs to inherit from this class.- Add
didTap: (() -> Void)?
closure to your component's init. - Bind
didTap
with the component view'shighlightingGesture
property in the component'srender(in:)
function:
//didTap's type is (() -> Void)?
view.highlightingGesture.didTap = didTap.map(HighlightingGesture.TapAction.resign)