Support sizing of UIKit interop views in Compose#2485
Merged
Conversation
ASalavei
reviewed
Oct 15, 2025
...rumentedTest/kotlin/androidx/compose/ui/interop/InteropUIKitViewSizingWithConstraintsTest.kt
Outdated
Show resolved
Hide resolved
ASalavei
reviewed
Oct 15, 2025
...InstrumentedTest/kotlin/androidx/compose/ui/interop/InteropUIKitViewSizingWithUILabelTest.kt
Show resolved
Hide resolved
ASalavei
reviewed
Oct 15, 2025
...i/src/uikitInstrumentedTest/kotlin/androidx/compose/ui/interop/InteropInteractionModeTest.kt
Outdated
Show resolved
Hide resolved
MatkovIvan
reviewed
Oct 16, 2025
.../ui/src/desktopMain/kotlin/androidx/compose/ui/viewinterop/SwingInteropViewHolder.desktop.kt
Outdated
Show resolved
Hide resolved
.../src/uikitMain/kotlin/androidx/compose/ui/viewinterop/UIKitInteropViewMeasurePolicy.uikit.kt
Outdated
Show resolved
Hide resolved
.../src/uikitMain/kotlin/androidx/compose/ui/viewinterop/UIKitInteropViewMeasurePolicy.uikit.kt
Outdated
Show resolved
Hide resolved
3acd400 to
49442a8
Compare
MatkovIvan
approved these changes
Oct 17, 2025
Member
MatkovIvan
left a comment
There was a problem hiding this comment.
LGTM, please wait approval from iOS folks too
|
LGTM, Also I have to mention that current implementation has known layout issues when used together with UI components that use NSLayoutConstraints mechanism (and works fine with SwiftUI and self-sizing views). |
ASalavei
approved these changes
Oct 17, 2025
Author
|
Description for this PR is updated and issue for support for |
mazunin-v-jb
approved these changes
Oct 20, 2025
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.
Adds support for sizing UIKit interop views in Compose based on each view’s fitting size. This PR adds support for sizing of SwiftUI
Views hosted byUIHostingControllerand for basicUIViewsubclasses which don't involve usage ofNSLayoutConstraints. MakesmeasurePolicyabstract inInteropViewHolder, requiring subclasses to override it instead of passing it into the initializer.Fixes CMP-9122 iOS support intrinsic sizing of interop elements - SwiftUI and UIView without constraints
Fixes CMP-7182 CMP SwiftUI wrapped content size does not work
Testing
Adds new test suits
InteropUIKitViewSizingWithConstraintsTestInteropUIKitViewSizingWithUILabelTestInteropUIMenuTestInteropInteractionModeTestRelease Notes
Features - iOS