public final class DSRadio: DSSelectionControl
An Enterprise-styled push button element in the style of a radio button. It includes properties for providing a label.
When enabled/disabled, the background color changes. In some situations, you may want this color to propagate to the superview automatically. To allow that, set appliesBackgroundColorToSuperview to true.
For storyboards, add a UIView to your view and change the class name to DSRadio. Also, note that in the storyboard the checkbox for Accessibility is unchecked, however, it will be enabled by default. Ignore the value of this checkbox. If you want to set this value to false, you must do so in code by setting isAccessibilityElement to false.
Initialize and set properties as needed.
let blueRadio = DSRadio() let redRadio = DSRadio() radio.title = "Blue" radio.groupName = "Primary Color" radio.isChecked = true radio.title = "Red" radio.groupName = "Primary Color" radio.isChecked = false
If you are using DSRadio in a table view, use DSRadioTableViewCell and it will take care of proper cell separation and other features for you.
Set a DSRadioDelegate to the component to get notified about value changes.
An abstract base component for selection controls. It should not be used externally.
@IBOutlet public weak var radioDelegate: DSRadioDelegate?
The delegate which receives updates on the DSRadio's state.
override public var isChecked: Bool
When true, the radio is checked. Unchecked otherwise.
public override var accessibilityValue: String?