import UIKit

public extension UIWindow {
    // Fetches the current UIWindow
    static var current: UIWindow? {
        for scene in UIApplication.shared.connectedScenes {
            guard let windowScene = scene as? UIWindowScene else { continue }
            for window in windowScene.windows {
                guard window.isKeyWindow else { continue }
                return window
            }
        }
        return nil
    }
}
