@@ -236,7 +236,7 @@ class Presenter: NSObject {
236
236
}
237
237
238
238
private func safeZoneConflicts( ) -> SafeZoneConflicts {
239
- guard let window = maskingView. window else { return [ ] }
239
+ guard let _ = maskingView. window else { return [ ] }
240
240
let windowLevel : UIWindow . Level = {
241
241
if let vc = presentationContext. viewControllerValue ( ) as? WindowViewController {
242
242
return vc. config. windowLevel ?? . normal
@@ -253,47 +253,34 @@ class Presenter: NSObject {
253
253
if let vc = presentationContext. viewControllerValue ( ) as? UITabBarController { return vc. sm_isVisible ( view: vc. tabBar) }
254
254
return false
255
255
} ( )
256
- if #available( iOS 11 , * ) {
257
- if windowLevel > . normal {
258
- // TODO seeing `maskingView.safeAreaInsets.top` value of 20 on
259
- // iPhone 8 with status bar window level. This seems like an iOS bug since
260
- // the message view's window is above the status bar. Applying a special rule
261
- // to allow the animator to revove this amount from the layout margins if needed.
262
- // This may need to be reworked if any future device has a legitimate 20pt top safe area,
263
- // such as with a potentially smaller notch.
264
- if maskingView. safeAreaInsets. top == 20 {
265
- return [ . overStatusBar]
266
- } else {
267
- var conflicts : SafeZoneConflicts = [ ]
268
- if maskingView. safeAreaInsets. top > 0 {
269
- conflicts. formUnion ( . sensorNotch)
270
- }
271
- if maskingView. safeAreaInsets. bottom > 0 {
272
- conflicts. formUnion ( . homeIndicator)
273
- }
274
- return conflicts
256
+ if windowLevel > . normal {
257
+ // TODO seeing `maskingView.safeAreaInsets.top` value of 20 on
258
+ // iPhone 8 with status bar window level. This seems like an iOS bug since
259
+ // the message view's window is above the status bar. Applying a special rule
260
+ // to allow the animator to revove this amount from the layout margins if needed.
261
+ // This may need to be reworked if any future device has a legitimate 20pt top safe area,
262
+ // such as with a potentially smaller notch.
263
+ if maskingView. safeAreaInsets. top == 20 {
264
+ return [ . overStatusBar]
265
+ } else {
266
+ var conflicts : SafeZoneConflicts = [ ]
267
+ if maskingView. safeAreaInsets. top > 0 {
268
+ conflicts. formUnion ( . sensorNotch)
275
269
}
270
+ if maskingView. safeAreaInsets. bottom > 0 {
271
+ conflicts. formUnion ( . homeIndicator)
272
+ }
273
+ return conflicts
276
274
}
277
- var conflicts : SafeZoneConflicts = [ ]
278
- if !underNavigationBar {
279
- conflicts. formUnion ( . sensorNotch)
280
- }
281
- if !underTabBar {
282
- conflicts. formUnion ( . homeIndicator)
283
- }
284
- return conflicts
285
- } else {
286
- #if SWIFTMESSAGES_APP_EXTENSIONS
287
- return [ ]
288
- #else
289
- if UIApplication . shared. isStatusBarHidden { return [ ] }
290
- if ( windowLevel > UIWindow . Level. normal) || underNavigationBar { return [ ] }
291
- let statusBarFrame = UIApplication . shared. statusBarFrame
292
- let statusBarWindowFrame = window. convert ( statusBarFrame, from: nil )
293
- let statusBarViewFrame = maskingView. convert ( statusBarWindowFrame, from: nil )
294
- return statusBarViewFrame. intersects ( maskingView. bounds) ? SafeZoneConflicts . statusBar : [ ]
295
- #endif
296
275
}
276
+ var conflicts : SafeZoneConflicts = [ ]
277
+ if !underNavigationBar {
278
+ conflicts. formUnion ( . sensorNotch)
279
+ }
280
+ if !underTabBar {
281
+ conflicts. formUnion ( . homeIndicator)
282
+ }
283
+ return conflicts
297
284
}
298
285
299
286
private func getPresentationContext( ) throws -> PresentationContext {
0 commit comments