2

I am trying to get the application to be the size of the full screen using Catalyst supported APIs. I have tried using the UIScreen proeprty as well as the window property(below), but both have the problem where the window does not fill the full screen.

I have attached my code, but the window does not occupy the full screen size.

        let windowRect = self.window?.frame
        let windowWidth = windowRect?.size.width
        let windowHeight = windowRect?.size.height
        UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.forEach { windowScene in
            windowScene.sizeRestrictions?.minimumSize = CGSize(width: windowWidth! , height:windowHeight! )
            windowScene.sizeRestrictions?.maximumSize = CGSize(width: windowWidth!, height: windowHeight!)

        }
Piavio
  • 54
  • 1
  • 4
  • Check https://stackoverflow.com/questions/58526250/is-it-possible-to-use-full-screen-in-mac-catalyst – Leszek Szary Dec 18 '19 at 10:08
  • Your method won't work In Catalina because screen sizes are always reported as 1920x1080. The real screen sizes should now be reported to Catalyst apps in Big Sur. Ref. https://developer.apple.com/forums/thread/652276?answerId=617896022#617896022 – endavid Jul 04 '20 at 08:12

0 Answers0