File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ struct PartialSheet: ViewModifier {
128
128
notifier. removeObserver ( self )
129
129
}
130
130
. onPreferenceChange ( PresenterPreferenceKey . self, perform: { ( prefData) in
131
- self . presenterContentRect = prefData. first? . bounds ?? . zero
131
+ DispatchQueue . main. async {
132
+ self . presenterContentRect = prefData. first? . bounds ?? . zero
133
+ }
132
134
} )
133
135
}
134
136
// if the device type is not an iPhone,
@@ -234,8 +236,10 @@ extension PartialSheet {
234
236
Spacer ( )
235
237
}
236
238
. onPreferenceChange ( SheetPreferenceKey . self, perform: { ( prefData) in
237
- withAnimation ( manager. defaultAnimation) {
238
- self . sheetContentRect = prefData. first? . bounds ?? . zero
239
+ DispatchQueue . main. async {
240
+ withAnimation ( manager. defaultAnimation) {
241
+ self . sheetContentRect = prefData. first? . bounds ?? . zero
242
+ }
239
243
}
240
244
} )
241
245
. frame ( width: UIScreen . main. bounds. width)
You can’t perform that action at this time.
0 commit comments