Skip to content

Commit

Permalink
fix: add workaround to address a crash on iOS 17
Browse files Browse the repository at this point in the history
  • Loading branch information
mohakapt committed Sep 20, 2023
1 parent f4eabe3 commit f2cc5bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/WindowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ internal final class WindowViewController: UIViewController {
// Workaround for https://github.com/omaralbeik/Drops/pull/22
let app = UIApplication.shared
let windowScene = app.activeWindowScene
let topViewController = windowScene?.windows.first(where: \.isKeyWindow)?.rootViewController?.top
// Workaround for https://github.com/omaralbeik/Drops/issues/45
var topViewController = windowScene?.windows.first(where: \.isKeyWindow)?.rootViewController?.top
if topViewController == self { topViewController = nil }
return topViewController?.preferredStatusBarStyle
?? windowScene?.statusBarManager?.statusBarStyle
?? .default
Expand Down

0 comments on commit f2cc5bf

Please sign in to comment.