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

Can't able to change State #69

Open
syedrazackimran opened this issue Nov 23, 2017 · 1 comment
Open

Can't able to change State #69

syedrazackimran opened this issue Nov 23, 2017 · 1 comment
Labels

Comments

@syedrazackimran
Copy link

syedrazackimran commented Nov 23, 2017

Hi,

I trying to change state like off and on (toggling). When i set button.on = false, i put log it's return true i don't know how to fix. kindly do need fully , herewith add some codes and screen shot of storyboard .

btn_terms.on = false btn_terms.boxType = .circle btn_terms.onAnimationType = .oneStroke btn_terms.offAnimationType = .fill btn_terms.tintColor = UIColor.lightGray btn_terms.onTintColor = UIColor(hexString: appColor.BGColor) btn_terms.onFillColor = UIColor.clear btn_terms.onCheckColor = UIColor(hexString: appColor.BGColor) btn_terms.animationDuration = 0.5 btn_terms.delegate = self

@IBAction func action_terms(_ sender: BEMCheckBox) { print(sender.on) if sender.on{ sender.setOn(false, animated: true) }else{ sender.setOn(true, animated: true) } }

i tried with delegate also but i'm starting state is on= false when i log its return as true

extension RegisterVC: BEMCheckBoxDelegate { func didTap(_ checkBox: BEMCheckBox) { if checkBox.on{ checkBox.setOn(false, animated: true) }else{ checkBox.setOn(true, animated: true) } } }

screen shot 2017-11-23 at 11 57 55 am

@Boris-Em
Copy link
Owner

Boris-Em commented Dec 6, 2017

Hi @syedrazackimran,

Thank you for opening this issue!
Here are a few clarifying questions:

  • Your delegate and IBAction are getting called, right?
  • When the delegate and IBAction are getting called, the state of the checkbox changes, right?
  • Are you sure that your reference to the checkbox is initiated when you try changing the state?

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

No branches or pull requests

2 participants