Issue #308

If you don’t want to use yet, it’s easy to roll out a closure based UIButton. The cool thing about closure is it captures variables

final class ClosureButton: UIButton {
    var didTouch: (() -> Void)?

    override init(frame: CGRect) {
        super.init(frame: frame)

        addTarget(self, action: #selector(buttonTouched(_:)), for: .touchUpInside)

    required init?(coder aDecoder: NSCoder) {

    @objc private func buttonTouched(_: UIButton) {

Then in cellForItem

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell: UserCell = collectionView.dequeue(for: indexPath)!
    let user = users[indexPath.item]
    cell.powerButton.didTouch = { [weak self] in
    return cell

With this we can even forward touch event to another button

func forwardTouchEvent(button: ClosureButton) {
    didTouch = { [weak button] in

Another benefit is that we can apply debouncing to avoid successive tap on button

let debouncer = Debouncer(timeInterval: 0.2)
@objc private func buttonTouched(_: UIButton) { { [weak self] in