Issue with "UIScene lifecyle"

Hi, my iOS app is no more starting correctly since this change:

I don’t really understand its purpose. I’m creating the app main window in the JUCEApplication::initialise() method, and strangely since that change, juce::Displays::getPrimaryDisplay()->userArea is empty when queried in JUCEApplication::initialise , and then it seems to be filled later.

So, am I using JUCE wrong, is there a different initialisation step to follow now on iOS ?

Note: strangely, if I postpone the creation of the main window by 1ms with a call to Timer::callAfterDelay at the end of initialise() , and if I first create a dummy component that I add to the “desktop” , then everything works again:

      Component *c = new Component; c->setSize(100,100); c->addToDesktop(0); 
      Timer::callAfterDelay(1, [this, c]() { 
           delete c; 
           createTheGUI(); 
      });

but of course this does not look like a proper fix.

Potentially addressed by this change:

Please could you try updating and check whether the issue is resolved?

Thanks, it mostly works but it seems there is still an inconsistency with orientation:

With your patch I see at the end of initialise():

getPrimaryDisplay userArea=[x=0, y=0, w=810, h=1080] totalArea=[x=0, y=0, 
w=1080, h=810] safeAreaInsets=[left=0, right=0, top=0, bottom=0] scale=2 
dpi=320

While with your patch + my “workaround” I see:

getPrimaryDisplay userArea=[x=0, y=0, w=1080, h=810] totalArea=[x=0, y=0, w=1080, h=810] safeAreaInsets=[left=0, right=0, top=0, bottom=0] scale=2 dpi=320

(note how the userArea width and height are swapped).

(the application requires landscape mode, and the ipad is initially in landscape orientation).

Thanks, I can repro that behaviour here.

When running a JUCE 8.0.8 app on an iPad running iOS 26 beta 8 under Xcode’s debugger, the following gets printed to the console:

`UIScene` lifecycle will soon be required. Failure to adopt will result in an assert in the future.

The patch you referred to adopts the UIScene lifecycle, silencing this warning, and ensuring compatibility with future OS versions.

Unfortunately, I can’t find a way to make the Display userArea return the correct display orientation, even when the app itself only declares landscape orientations as supported. Checking the physical device orientation won’t work as a placeholder, since in “stage manager” mode, apps that only support landscape may still be displayed, scaled-down, when the device is in portrait mode. In order to find out the geometry of the app’s main window, I think we need to wait until the system has created a UIWindowSession for us, which won’t have happened yet in initialise().

JUCE will update the available Displays when the UIScene state changes, and will then will notify top-level Components by calling their parentSizeChanged() member function. Perhaps you could try overriding this function on your top-level component to update your GUI’s layout.

Oh, too bad. I think I’ll keep my ugly workaround for now, until I implement proper handling of portrait mode.