Repository navigation
[iPhone Duo] update uiscenedelegate documentation for scene geometry change - #14012
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the uiscenedelegate.md documentation by adding the windowScene:didUpdateEffectiveGeometry: lifecycle method to both the Swift and Objective-C code examples. However, both snippets incorrectly target iOS 26.0 instead of iOS 16.0, which would prevent the geometry updates from being forwarded to Flutter on current iOS versions. Additionally, the Swift snippet uses the incorrect type UIWindowScene.Geometry instead of UIWindowSceneGeometry.
|
Staged preview of the updated docs.flutter.dev site (updated for commit e1dba9e): |
sfshaza2
left a comment
There was a problem hiding this comment.
lgtm. Thanks, @hellohuanlin!
|
@hellohuanlin can you revert this? flutter/flutter#195508 needs to land in stable before this documentation can be updated. |
#14014) …eometry change (#14012)" This reverts commit 626cfa2. Sorry I had to revert it until the change is landed to stable. _Description of what this PR is changing or adding, and why:_ _Issues fixed by this PR (if any):_ _PRs or commits this PR depends on (if any):_ ## Presubmit checklist - [ ] If you are unwilling, or unable, to sign the CLA, even for a _tiny_, one-word PR, please file an issue instead of a PR. - [ ] If this PR is not meant to land until a future stable release, mark it as draft with an explanation. - [ ] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style)—for example, it doesn't use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first-person pronouns). - [ ] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.
This is a follow up to flutter#195199 As discussed [in this thread](flutter#195199 (comment)), For a fixed-size FlutterView, `viewDidLayoutSubviews` is called when switching from outer to inner display, but not called when switching from inner to outer display. This is a puzzling behavior (possibly a bug in UIKit), but it does prove that relying on `viewDidLayoutSubviews` is not complete. The only API we can find that triggers when a scene changes screen is `didUpdateEffectiveGeometry`. There won't be a breaking change, but it would require `FlutterSceneLifeCycleProvider` users to add a one-liner for this to work. We should update our website to include this ([PR](flutter/website#14012)): ``` @available(iOS 26.0, *) func windowScene(_ windowScene: UIWindowScene, didUpdateEffectiveGeometry previousEffectiveGeometry: UIWindowScene.Geometry) { sceneLifeCycleDelegate.windowScene(windowScene, didUpdateEffectiveGeometry: previousEffectiveGeometry) } ``` ## Testing I have manually verified with a fixed-size 300x300 FlutterView, and confirmed the information is correctly updated when switching screen. It is not possible to write integration test - I don't think there's a `simctl` sub-command that allows us to fold/unfold the simulator. We could add a integration test in the future if such api become available. Fixes flutter#195177 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. 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](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot 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. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This accompanies this change: flutter/flutter#195508
On iPhone Duo, when switching between inner/outer screens, we want to make sure the display info is correctly updated to the dart side.
Presubmit checklist
of 80 characters or fewer.