EnterpriseDS Documentation

Structure DSUICheckbox

@available(iOS 13.0, tvOS 13.0, *)
public struct DSUICheckbox: View, DSSelectionControlDetails  

An Enterprise-styled push button element in the style of a checkbox for use in SwiftUI views.

isChecked is a binding boolean initializer parameter title is a string initializer parameter groupName is a string initializer parameter

When enabled/disabled, the background color changes. In some situations, you may want this color to propagate to the superview automatically. To allow that, use the binding sharedBackgroundColor optional initializer parameter to extract the color and used it in a parent view.

Initialize and set properties as needed.

DSUICheckbox(isChecked: $checkboxGreen, title:  checkboxTitle, groupName: "Group Name", sharedBackgroundColor: $checkboxBackgroundColor)
.disabled(false)

DSUICheckbox(isChecked: $checkboxGreen, title:  checkboxTitle, groupName: "Group Name")

DSUICheckbox(isChecked: $checkboxGreen, title: "I agree to this policy", groupName: "Group Name")
DSUICheckbox DSUICheckbox DSSelectionControlDetails DSSelectionControlDetails DSUICheckbox->DSSelectionControlDetails View View DSUICheckbox->View

Conforms To

View

Initializers

init(is​Checked:​title:​group​Name:​shared​Background​Color:​)

public init(isChecked: Binding<Bool>, title: String, groupName: String = "", sharedBackgroundColor: Binding<Color?>? = nil)  

Initializes and creates a checkbox .

Parameters

is​Checked Binding<Bool>

The binding Bool to track the state of the checkbox.

title String

The title of the checkbox.

group​Name String

The groupName of checkbox.

shared​Background​Color Binding<Color?>?

The binding optional Color to extract the background color of the checkbox.

Properties

body

public var body: some View