Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to record touch events for BEMCheckBox in UITableView or UICollectionView #83

Open
chejarla-venkatesh opened this issue Aug 29, 2018 · 1 comment

Comments

@chejarla-venkatesh
Copy link

chejarla-venkatesh commented Aug 29, 2018

I am having a collectionView with images and a checkBox on the topLeft corner and I want to record tap event for the checkBox so that I can save the state of the cell to overCome scrolling problem for collectionView.. If the checkBox is in normal View I can conform to the protocol and implement didTap(_ checkBox: BEMCheckBox) to handle and listen to touchEvents but what if the checkBox is placed in a collectionViewCell. All I want to know is, can I create a action method or implement a function and add it as target to the reference of BEMCheckbox like below??
stateCheckBox.addTarget(self, action: #selector(checkBoxTapped(_:)), for: .touchUpInside)

@chejarla-venkatesh chejarla-venkatesh changed the title How to record touch events for checkBox in UITableView or UICollectionView How to record touch events for BEMCheckBox in UITableView or UICollectionView Aug 31, 2018
@fidmor89
Copy link

fidmor89 commented Oct 4, 2018

implement BEMCheckBoxDelegate and these functions:
`func didTap(_ checkBox: BEMCheckBox) {
delegate?.CheckBoxDidTap(checkBox)
}

func animationDidStop(for checkBox: BEMCheckBox) {
    delegate?.CheckBoxAnimationDidStop(for: checkBox)
}`

Also don't forget to set the delegate for your method, something like:
checkBox.delegate = self

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants