can't click UIButton inside a cell in UITableview

前端 未结 13 2017
生来不讨喜
生来不讨喜 2021-02-05 09:51

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:

13条回答
  •  萌比男神i
    2021-02-05 10:21

    For Swift 3 and Storyboard

    For me, I had to enable multiple touch inside the content view, and enable user interaction on everything - the table view, table view cell, content view, and UIButton. I was using storyboard.

    I also set up my tableview cell as a subclass.

    Since I couldn't find an answer here when I was exploring the problem, I posted another question on stack overflow about this. You can see my code and download a project with this working here: Can't click button inside UITableViewCell?

提交回复
热议问题