searched already some possible fixes but all did not solve mine.
i keep clicking the cell in the uitableview rather than the buttons inside it.
here is my code:
I was doing this:
let plusButton: UIButton = {
let v = UIButton()
v.setImage(plusImg, for: .normal)
v.tintColor = .dark
v.translatesAutoresizingMaskIntoConstraints = false
v.addTarget(self, action: #selector(plusButtonHandler), for: .touchUpInside)
// adding targets here did not work
return v
}()
And it appears invoking the addTarget method inside of the closure did not work. When I factored the addTarget method out and instead put it in the initializer, everything worked!