Skip to content

Instantly share code, notes, and snippets.

@rajuashok
Created January 14, 2020 16:54
Embed
What would you like to do?
OnClick example for single choice RadioButton group
func onClick(_ sender: UIView) {
guard let currentRadioButton = sender as? RadioButton else {
return
}
[
radioButton1,
radioButton2
].forEach { $0.isChecked = false } // Set all to unchecked first
currentRadioButton.isChecked = !currentRadioButton.isChecked
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment