EnterpriseDS Documentation

Structure DSUISwitch​Cell

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

An Enterprise-styled option selection element for use in SwiftUI views.

Initialize and set parameters as needed.

DSUISwitchCell(labelText: "Notifications",
               isOn: $isNotificationsOn,
               sharedBackgroundColor: $rowBackgroundColor)

The isOn binding will let you know the current state of the switch, true for on and false for off.

When using this component in a cell, the background color should be changed when the component is disabled. To let DSUISwitchCell handle this for you, provide a color binding and set your background to the color. If this component will never be disabled, you can ignore it.

DSUISwitchCell DSUISwitchCell View View DSUISwitchCell->View

Conforms To

View

Initializers

init(label​Text:​is​On:​shared​Background​Color:​)

public init(labelText: String, isOn: Binding<Bool>, sharedBackgroundColor: Binding<Color>? = nil)  

Properties

body

public var body: some View