Repository navigation
iOS: Migrate the scenario app to UIScene - #190649
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request transitions the iOS scenario app to the UIScene lifecycle by introducing SceneDelegate and updating the application manifests. The window and root view controller initialization logic is moved from AppDelegate to SceneDelegate, and the test files are updated to access the window via SceneDelegate.mainWindow. The review feedback identifies two instances in SceneDelegate.m where a nullable message parameter is deserialized using NSJSONSerialization without a null check, which could lead to application crashes.
hellohuanlin
reviewed
Aug 6, 2026
Apps that haven't adopted the UIScene life cycle do not run on iOS 27. This updates the scenarios app to include a `UIApplicationSceneManifest` in the app's `Info.plist` and moves the window setup into a `SceneDelegate` that subclasses `FlutterSceneDelegate`, similar to what we do in `dev/integration_tests/ios_add2app_uiscene`. We create the window from the connected `UIWindowScene` and make it key before calling to super, which is where the engine forwards the connection event on to plugins. I've kept the bits that aren't UI setup in `AppDelegate`: the guard against `--enable-software-rendering` and the `ContinuousTexture` registration, which we register against the implicit engine rather than the one the scenario builds. Since the window now belongs to the scene delegate rather than the application delegate, the tests that reached it via `UIApplication.sharedApplication.delegate.window` have been updated to use the new `SceneDelegate.mainWindow` instead. They assert that it is non-nil before using it: with no connected scene, presenting on the root view controller, assigning it, and rendering the layer are all silent no-ops that surface as an expectation timeout rather than as a missing window. Because it's still there, `Info_Skia.plist` gets the same manifest to stay in sync with `Info.plist`, from which it differs only in `FLTEnableImpeller`; that said we no longer support a Skia backend, so I'll delete this in a followup. Issue: flutter#188336
cbracken
force-pushed
the
migrate-scenario-to-uiscene
branch
from
August 6, 2026 21:23
ddb33e6 to
b83b33a
Compare
cbracken
enabled auto-merge
August 6, 2026 22:39
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apps that haven't adopted the UIScene life cycle do not run on iOS 27.
This updates the scenarios app to include a
UIApplicationSceneManifestin the app'sInfo.plistand moves the window setup into aSceneDelegatethat subclassesFlutterSceneDelegate, similar to what we do indev/integration_tests/ios_add2app_uiscene. We create the window from the connectedUIWindowSceneand make it key before calling to super, which is where the engine forwards the connection event on to plugins.I've kept the bits that aren't UI setup in
AppDelegate: the guard against--enable-software-renderingand theContinuousTextureregistration, which we register against the implicit engine rather than the one the scenario builds.Since the window now belongs to the scene delegate rather than the application delegate, the tests that reached it via
UIApplication.sharedApplication.delegate.windowhave been updated to use the newSceneDelegate.mainWindowinstead. They assert that it is non-nil before using it: with no connected scene, presenting on the root view controller, assigning it, and rendering the layer are all silent no-ops that surface as an expectation timeout rather than as a missing window.Because it's still there,
Info_Skia.plistgets the same manifest to stay in sync withInfo.plist, from which it differs only inFLTEnableImpeller; that said we no longer support a Skia backend, so I'll delete this in a followup.Issue: #188336
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.