diff --git a/Sources/UINotificationCenter.swift b/Sources/UINotificationCenter.swift index 3a9fb9b..007be97 100644 --- a/Sources/UINotificationCenter.swift +++ b/Sources/UINotificationCenter.swift @@ -31,7 +31,7 @@ public final class UINotificationCenter { // MARK: Private properties /// The window which will be placed on top of the application window. - /// This window is used to present the notifications on and will be hided when all notifications are presented. + /// This window is used to present the notifications on and will be hidden when notifications are dismissed. internal let window: UIWindow /// Handles queueing of all notifications. Contains a queue of `UINotificationRequest` objects. diff --git a/Sources/UINotificationPresentationContext.swift b/Sources/UINotificationPresentationContext.swift index e5f5be8..8d4e13a 100644 --- a/Sources/UINotificationPresentationContext.swift +++ b/Sources/UINotificationPresentationContext.swift @@ -52,7 +52,7 @@ public final class UINotificationPresentationContext { private func prepareContainerWindow() { containerWindow.windowLevel = windowLevel #if !TEST - containerWindow.makeKeyAndVisible() + containerWindow.isHidden = false #endif } @@ -94,9 +94,6 @@ public final class UINotificationPresentationContext { /// Move the window behind the key application window. containerWindow.windowLevel = UIWindow.Level.normal - 1 containerWindow.rootViewController = nil - - /// Make sure the key window of the app is visible again. - guard let applicationWindow = UIApplication.shared.windows.first(where: { $0 != self.containerWindow }) else { return } - applicationWindow.makeKeyAndVisible() + containerWindow.isHidden = true } }