# Issue with "UIScene lifecyle"

**URL:** <https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017>\
**Category:** MacOSX and iOS\
**Created:** [September 2, 2025, 4:51pm UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017 "2025-09-02T16:51:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [September 2, 2025, 4:51pm UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017/1 "2025-09-02T16:51:22Z")

</div>

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

> <https://github.com/juce-framework/JUCE/commit/70a2dd7e15b1becfbea8eb36ca37c04edaefcbaa>

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:

```auto
      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.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [September 2, 2025, 6:38pm UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017/2 "2025-09-02T18:38:40Z")

</div>

Potentially addressed by this change:

> <https://github.com/juce-framework/JUCE/commit/7bc7dff6f66396e2e7c1c2132ce455faa2756758>
>
> initWithWindowScene appears to create a window with no area if the
> provided scen…e is null. As a fallback, creating a window without an
> associated scene still returns usable bounds.

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

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [September 3, 2025, 8:39am UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017/3 "2025-09-03T08:39:34Z")

</div>

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

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

```auto
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).

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [September 3, 2025, 12:44pm UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017/4 "2025-09-03T12:44:02Z")

</div>

Thanks, I can repro that behaviour here.

> [@jpo](#):
>
> Hi, my iOS app is no more starting correctly since this change… I don’t really understand its purpose.

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:

```auto
`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.

---

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [September 3, 2025, 1:16pm UTC](https://forum.juce.com/t/issue-with-uiscene-lifecyle/67017/5 "2025-09-03T13:16:16Z")

</div>

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