File tree 1 file changed +29
-4
lines changed 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ struct VMNavigationListView: View {
96
96
private struct VMListModifier : ViewModifier {
97
97
@EnvironmentObject private var data : UTMData
98
98
@State private var settingsPresented = false
99
+ @State private var sheetPresented = false
99
100
100
101
func body( content: Content ) -> some View {
101
102
content
@@ -126,13 +127,37 @@ private struct VMListModifier: ViewModifier {
126
127
}
127
128
#endif
128
129
}
130
+ #if os(iOS)
131
+ // SwiftUI bug on iOS 14.4 and previous versions prevents multiple .sheet from working
132
+ . sheet( isPresented: $sheetPresented) {
133
+ if data. showNewVMSheet {
134
+ VMWizardView ( )
135
+ } else if settingsPresented {
136
+ UTMSettingsView ( )
137
+ }
138
+ }
139
+ . onChange ( of: data. showNewVMSheet) { newValue in
140
+ if newValue {
141
+ settingsPresented = false
142
+ sheetPresented = true
143
+ }
144
+ }
145
+ . onChange ( of: settingsPresented) { newValue in
146
+ if newValue {
147
+ data. showNewVMSheet = false
148
+ sheetPresented = true
149
+ }
150
+ }
151
+ . onChange ( of: sheetPresented) { newValue in
152
+ if !newValue {
153
+ settingsPresented = false
154
+ data. showNewVMSheet = false
155
+ }
156
+ }
157
+ #else
129
158
. sheet( isPresented: $data. showNewVMSheet) {
130
159
VMWizardView ( )
131
160
}
132
- #if os(iOS)
133
- . sheet( isPresented: $settingsPresented) {
134
- UTMSettingsView ( )
135
- }
136
161
#endif
137
162
}
138
163
You can’t perform that action at this time.
0 commit comments