Structure
DSUIRadio
@available(iOS 13.0, tvOS 13.0, *)
public struct DSUIRadio<T: DSUISelectionGroupItem>: View, DSSelectionControlDetails
An Enterprise-styled push button element in the style of a radio button for use in SwiftUI views.
item is a DSUISelectionGroupItem initializer parameter groupName is a string initializer parameter selectedItem is a binding optional of DSUISelectionGroupItem 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 individually or in a ForEach
DSUIRadio(item: step1Config.radioDrinks[index], groupName: "Group Name",
selectedItem: $step1Config.selectedDrink, sharedBackgroundColor: $checkboxBackgroundColor)
.disabled(false)
ForEach(step1Config.radioDrinks.indices) { index in
DSUIRadio(item: step1Config.radioDrinks[index], groupName: favoriteDrinkGroup, selectedItem: $step1Config.selectedDrink)
.disabled(index == 3)
.frame(minWidth: .zero, maxWidth: .infinity)
}
}
Relationships
Conforms To
View
Initializers
Properties
body
public var body: some View