DavydLiu / DLRadioButton

Radio Button for iOS
MIT License
944 stars 202 forks source link

Deselect radio button after it's been selected. #139

Open nikoagge opened 6 years ago

nikoagge commented 6 years ago

Has anyone found how to do this programmatically in Swift?

aleksandrovych commented 6 years ago

var shouldSelect: Bool = true @IBAction func radioButtonClicked() { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { self.radioButton.isSelected = self.shouldSelect self.shouldSelect = !self.shouldSelect }

}
antoniohart commented 5 years ago

Hi you can just assign the radio button you used to false

E.g self.radioButton.isSelected = false

yoni-g commented 3 years ago

There's an option to config it without an outlet. If you do want to toggle, you can actually set isMultipleSelectionEnabled property to true. Please see this issue.