You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
688 B
28 lines
688 B
//
|
|
// ToggleView.swift
|
|
// ArkitDoushiQi
|
|
//
|
|
// Created by Johan LACHENAL on 21/05/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ToggleView: View {
|
|
@AppStorage("isDarkMode") private var isDarkMode = false
|
|
var body: some View {
|
|
Divider().background(Color.gray).padding(.vertical, 1)
|
|
Toggle("Dark Mode", isOn: $isDarkMode)
|
|
.toggleStyle(SwitchToggleStyle(tint: .blue))
|
|
.padding(EdgeInsets(top: 0, leading: 48, bottom: 0, trailing: 48))
|
|
Divider().background(Color.gray).padding(.vertical, 1)
|
|
}
|
|
}
|
|
|
|
struct ToggleView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
VStack{
|
|
ToggleView()
|
|
}
|
|
}
|
|
}
|