Class
DSCheckbox
public final class DSCheckbox: DSSelectionControl
An Enterprise-styled push button element in the style of a checkbox. 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 DSCheckbox.
Initialize and set properties as needed.
let checkbox = DSCheckbox()
checkbox.title = "I agree to this policy"
checkbox.appliesBackgroundColorToSuperview = true
checkbox.isChecked = false
If you are using DSCheckbox in a table view, use DSCheckboxTableViewCell and it will take care of proper cell separation and other features for you. 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. Set a DSCheckboxDelegate to the component to get notified about value changes.
Relationships
Superclass
DSSelectionControl
An abstract base component for selection controls. It should not be used externally.
Properties
checkboxDelegate
@IBOutlet public weak var checkboxDelegate: DSCheckboxDelegate?
The delegate which receives updates on the DSCheckbox's state.
isChecked
override public var isChecked: Bool
When true, the checkbox is checked. Unchecked otherwise.
accessibilityValue
public override var accessibilityValue: String?