struct ToggleView: View {
@State private var toggleValue: Bool = true
var body: some View {
Toggle(isOn: $toggleValue, label: {})
.toggleStyle(SwitchToggleStyle(tint: Color(red: 1.0, green: 0.5696961, blue: 0.9999913)))
.introspectSwitch(customize: { (toggle) in
toggle.thumbTintColor = UIColor.purple
})
.background(Color(red: 0.9529412, green: 0.9529412, blue: 0.18431373))
.frame(width: DynamicSizeHelper.getWidth(322), height: DynamicSizeHelper.getHeight(31), alignment: .topLeading)
.aspectRatio(contentMode: .fill)
.labelsHidden()
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter