Skip to content

Conversation

@svastven
Copy link

@svastven svastven commented Oct 15, 2025

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 by UIHostingController and for basic UIView subclasses which don't involve usage of NSLayoutConstraints. Makes measurePolicy abstract in InteropViewHolder, 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

  • InteropUIKitViewSizingWithConstraintsTest
  • InteropUIKitViewSizingWithUILabelTest
  • InteropUIMenuTest
  • InteropInteractionModeTest

Release Notes

Features - iOS

  • Add support for sizing of UIKit interop views in Compose.

@svastven svastven changed the title Draft: Support sizing of UIKit interop views in Compose Support sizing of UIKit interop views in Compose Oct 15, 2025
@svastven svastven changed the title Support sizing of UIKit interop views in Compose Draft: Support sizing of UIKit interop views in Compose Oct 15, 2025
@svastven svastven changed the title Draft: Support sizing of UIKit interop views in Compose Support sizing of UIKit interop views in Compose Oct 15, 2025
@svastven svastven marked this pull request as draft October 15, 2025 09:39
@svastven svastven requested a review from ASalavei October 15, 2025 09:40
@svastven svastven marked this pull request as ready for review October 15, 2025 13:24
@svastven svastven force-pushed the svastven/sizing-interop-views-in-compose branch from 3acd400 to 49442a8 Compare October 17, 2025 12:44
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please wait approval from iOS folks too

@ASalavei
Copy link

ASalavei commented Oct 17, 2025

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).
Because it's non-trivial fix, it can be implemented in a separate MR. Please file a separate issue for it.

@svastven
Copy link
Author

Description for this PR is updated and issue for support for NSLayoutConstraints CMP-9123 is created.

@svastven svastven merged commit 02e6b90 into jb-main Oct 20, 2025
44 of 49 checks passed
@svastven svastven deleted the svastven/sizing-interop-views-in-compose branch October 20, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants