gh-XcodesOrg-XcodesApp/Xcodes/Frontend/Preferences/ExperiementsPreferencePane.swift
Anand Biligiri 6e64db26fb Disallow changes to managed preferences
- Define enumerations for preferences that can be managed in an enterprise environment using MDM
- Add methods in AppState to check for managed preferences
- Update Advanced, Download, Experiments and Update preference panes to disable controls
  to modify any of the managed preferences
- Update Xcode category list button to be disabled if preference is managed
2024-06-21 07:17:18 +05:30

37 lines
1.1 KiB
Swift

import AppleAPI
import Path
import SwiftUI
struct ExperimentsPreferencePane: View {
@EnvironmentObject var appState: AppState
var body: some View {
VStack(alignment: .leading, spacing: 20) {
GroupBox(label: Text("FasterUnxip")) {
VStack(alignment: .leading) {
Toggle(
"UseUnxipExperiment",
isOn: $appState.unxipExperiment
)
.disabled(appState.disableUnxipExperiment)
Text("FasterUnxipDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
.fixedSize(horizontal: false, vertical: true)
}
.groupBoxStyle(PreferencesGroupBoxStyle())
}
}
}
struct ExperimentsPreferencePane_Previews: PreviewProvider {
static var previews: some View {
Group {
ExperimentsPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 600)
}
}
}