build out enable delete option but cant use b/c list view is not a list

re-arrange the content view
This commit is contained in:
Trey t
2022-01-29 11:22:59 -06:00
parent 423be2a30c
commit 2aa59a084a
4 changed files with 89 additions and 70 deletions

View File

@@ -21,26 +21,28 @@ struct SettingsView: View {
@ObservedObject var syncMonitor = SyncMonitor.shared
@AppStorage(UserDefaultsStore.Keys.useCloudKit.rawValue, store: GroupUserDefaults.groupDefaults) private var useCloudKit = false
@AppStorage(UserDefaultsStore.Keys.deleteEnable.rawValue, store: GroupUserDefaults.groupDefaults) private var deleteEnabled = true
var body: some View {
ZStack {
Color(UIColor.secondarySystemBackground)
VStack {
closeButtonView
.padding()
cloudKitEnable
addTestDataCell
clearDB
changeIcon
showOnboardingButton
whyBackgroundMode
specialThanksCell
if useCloudKit {
cloudKitStatus
Group {
closeButtonView
.padding()
cloudKitEnable
addTestDataCell
clearDB
changeIcon
showOnboardingButton
whyBackgroundMode
specialThanksCell
if useCloudKit {
cloudKitStatus
}
}
Spacer()
}
.padding()
@@ -230,6 +232,19 @@ struct SettingsView: View {
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
private var canDelete: some View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Toggle(String(localized: "settings_use_delete_enable"),
isOn: $deleteEnabled)
.padding()
}
}
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
}
struct SettingsView_Previews: PreviewProvider {