Boris-Em/BEMCheckBox

Temporary Variable

Closed this issue · 2 comments

Hi All,
If we have checkbox in the tableView. How to retrieve the particular row number or section number. While func didTap(_ checkBox: BEMCheckBox) {} . I can retrieve row number by setting checkBox.tag = rowNumber. There should something name of the checkbox or description.where We can set the row and section number.

Any alternative to when the func didTap(_ checkBox: BEMCheckBox) {} called How to retrieve row number and section number for the table.

Thanks,
Booma

Hi @BoomaRajan,

This is actually a very generic problem that you're trying to solve, and it's not related to BEMCheckBox.
For example, you would run into the same problem if you used UIButtons instead of a checkbox.
Take a look at this SO issue for example: https://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview

Feel free to reopen this issue if you believe that I misunderstood your issue. Thanks!

Thanks for your reply.
I have solved my issue . Below lines of code

     cell.checkBox.tag = indexPath.row
     cell.checkBox.accessibilityIdentifier = String(indexPath.section).
I would be nice if you have some variable to identify the checkbox