Swift UIWindow how to add in full screen mode

449 Views Asked by At

I am trying to add another UIWindow and make it makeKeyAndVisible above main window. But is appears as sheet (modal) not in fullScreen mode

I've tried to user modalPresentationStyle on viewController and nothing changes.

 rootViewController = baseViewController
        windowLevel = .alert
        backgroundColor = .clear
        isOpaque = false
        rootViewController?.modalPresentationStyle = .fullScreen
1

There are 1 best solutions below

0
Saurabh Pathak On

try with this

rootViewController = baseViewController
    windowLevel = .alert
    backgroundColor = .clear
    isOpaque = false
    rootViewController?.modalPresentationStyle = .fullScreen
self.present(rootViewController, animated: true, completion: nil)