Unified detail views, model
This commit is contained in:
26
CHDataManagement/Views/Generic/BoolPropertyView.swift
Normal file
26
CHDataManagement/Views/Generic/BoolPropertyView.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
import SwiftUI
|
||||
|
||||
struct BoolPropertyView: View {
|
||||
|
||||
let title: LocalizedStringKey
|
||||
|
||||
@Binding
|
||||
var value: Bool
|
||||
|
||||
let footer: LocalizedStringKey
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
HStack {
|
||||
Text(title)
|
||||
.font(.headline)
|
||||
Spacer()
|
||||
Toggle("", isOn: $value)
|
||||
.toggleStyle(.switch)
|
||||
}
|
||||
Text(footer)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.bottom)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user