9
fileprivate lazy var netTipWindow:UIWindow = {
        let window = UIWindow(frame: CGRect(x: 0, y: topMargins, width: UIScreenW, height: realheight))
        window.backgroundColor = .clear
        window.windowLevel = .alert
        window.isHidden = false
        window.rootViewController = UIViewController()
        window.rootViewController?.view.addSubview(self)
        frame = CGRect(x: 0, y: -(topMargins + realheight), width: UIScreenW, height: realheight)
        return window
    }()

My Code works well in ios 12, but it works like the picture.

Also, I tried this code, it makes no difference

    fileprivate lazy var netTipWindow:UIWindow = {
        let window = UIWindow(frame: CGRect(x: 0, y: topMargins, width: UIScreenW, height: realheight))
        window.backgroundColor = .clear
        window.windowLevel = .alert
        window.isHidden = false
        if #available(iOS 13, *) {
            window.addSubview(self)
        } else {
            window.rootViewController = UIViewController()
            window.rootViewController?.view.addSubview(self)
        }
        frame = CGRect(x: 0, y: -(topMargins + realheight), width: UIScreenW, height: realheight)
        return window
    }()

iOS 13 status bar

Micky
  • 5,578
  • 7
  • 31
  • 55
changwu
  • 91
  • 2
  • Having the same issue. Did you find any solution for this? – Micky Aug 22 '19 at 08:09
  • Same issue but not playing with window in the first place. I've also looked int [this](https://stackoverflow.com/questions/57060606/uiwindow-not-showing-over-content-in-ios-13) and play around with `UIWindowScene` but with no luck. Any updates anyone? – Nicholas Allio Aug 26 '19 at 10:36

1 Answers1

-1

this code....

- (BOOL)prefersStatusBarHidden {
    if (@available(iOS 13.0, *)) {
        // safearea iPhone x, xr ..
        if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.top > 20.0) {
            return NO;
        }
        else {
            return YES;
        }
    }
    else {
        return NO;
    }
}
LJJ
  • 1
  • 1