UIButton not responding used in a custom UITableViewCell

后端 未结 6 1490
感动是毒
感动是毒 2020-12-20 19:29

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

6条回答
  •  情歌与酒
    2020-12-20 19:56

    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
    }
    

提交回复
热议问题