Create iOS windows with scene lifecycle - #99
Conversation
8227194 to
4dcff15
Compare
|
Hi @tryk016 ! From what I know, scene-life cycle makes sense only if application is going to support multiple window, at cost of overengineering. As alternative, maybe raise |
|
You're right about |
Try
left a comment
There was a problem hiding this comment.
Look good now already.
As cleanup: I think it's fine to bump build target to 13 (or event 15) - so we wont need support iOS before UIWindowScene.
|
Thanks! Bumping the iOS deployment target to 15 makes sense. It will let me remove the legacy app delegate path and should simplify the next iOS changes as well. I'll update the PR. |
|
|
||
| static void configureWindowForScene(TempestWindow* window, UIWindowScene* scene) | ||
| API_AVAILABLE(ios(13.0)) { | ||
| #if defined(__IPHONE_26_0) && \ |
There was a problem hiding this comment.
why do you need compile-time and runtime checks side-by-side here?
There was a problem hiding this comment.
The compile-time check keeps Tempest buildable with SDKs older than 26, where UIWindowSceneGeometry.coordinateSpace isn't declared. The runtime check is needed because we target iOS 15, so a build made with the current SDK can still run on iOS 15–25.
There was a problem hiding this comment.
sure, I can read that from the code :)
Question is: is pre 26 sdk needed for anything?
There was a problem hiding this comment.
We don’t need it for the port. I kept it for older Xcode versions, but even the 2018 Intel Mac mini can run Xcode 26.0. Do you see a reason to keep supporting older SDKs, or would SDK 26 be a reasonable minimum for Tempest?
There was a problem hiding this comment.
Yes, it's totally fine, since it's matter of download for developer.
If something - we can always bring back guards.
There was a problem hiding this comment.
Done, removed the compile-time guard.
|
Merged, thanks! |
This moves native iOS window creation out of didFinishLaunchingWithOptions and into Tempest createWindow. It uses the UIWindowScene lifecycle, creates the window for the connected scene, and pauses rendering while the scene is inactive.
The display-link callback only marks a frame pending and queues the engine resume after the UIKit callback has returned. Queued callbacks are discarded after a lifecycle transition.
The iOS deployment target is now 15. iOS hosts must provide UIApplicationSceneManifest. Tempest continues to expose one native iOS window.
appleMain remains non-inlined so its stack frame is created after Tempest switches to appleStack.
Validated with macOS tests, iPhoneOS and iPhone Simulator builds, strict compilation and static analysis, simulator background/resume, and the scene-disconnect teardown probe.