I know this issue is already been asked few times in SO. Despite trying those out, I am still unable to solve my problem.
I am using a UITableView inside a UIViewCo
Also, make sure you are adding target actions to your buttons outside their setup. So instead of
let button: UIButton = { //addTarget... }()
you can have a function to set up your buttons after something happens:
func setButtonsUp() { // myButton.addTarget }