Skip to content

Comments

UIView-based Compose integration API#2589

Merged
ASalavei merged 22 commits intojb-mainfrom
andrei.salavei/compose-view
Dec 15, 2025
Merged

UIView-based Compose integration API#2589
ASalavei merged 22 commits intojb-mainfrom
andrei.salavei/compose-view

Conversation

@ASalavei
Copy link

@ASalavei ASalavei commented Nov 24, 2025

  • Implement ComposeUIView API to allow Compose content to be placed directly in the view hierarchy without explicitly attaching it to the parent View Controller. However, the UIViewController must still be present in the hierarchy.
  • Move common Compose logic to the ComposeContainer class.
  • Create the base class ComposeContainerConfiguration for the ComposeUIViewConfiguration and ComposeUIViewControllerConfiguration.
  • Update Instrumented Tests to run on both UIView- and UIViewController-based Compose container.

Fixes https://youtrack.jetbrains.com/issue/CMP-8478/Implement-UIView-based-compose-injection-API
Fixes https://youtrack.jetbrains.com/issue/CMP-7805/Unable-to-render-composable-inside-SwiftUI-Form

Release Notes

Features - iOS

  • Added a new ComposeUIView API enabling Compose embedding in view hierarchy

Fixes - iOS

  • Fix ability to place Compose inside the SwiftUI Form view

@ASalavei ASalavei changed the title Andrei.salavei/compose view Introduce UIView-based Compose integration API Nov 24, 2025
@ASalavei ASalavei changed the title Introduce UIView-based Compose integration API UIView-based Compose integration API Nov 24, 2025
@ASalavei ASalavei marked this pull request as ready for review December 5, 2025 14:09
@mazunin-v-jb mazunin-v-jb self-requested a review December 9, 2025 12:03
Comment on lines +21 to +23
/**
* Base configuration of the Compose container.
*/
Copy link
Member

Choose a reason for hiding this comment

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

For the public, it should contain more details. At lease references to usages

Copy link
Author

Choose a reason for hiding this comment

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

Generally it looks okay since all the internal properties are documented. Added references to the point of use in child classes.

}
}

println("Debug: Running test with ComposeHostingViewController")
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep this println in jb-main?
I see that there is a pattern to hide it under const flag and set it to false

Copy link
Author

Choose a reason for hiding this comment

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

That's for tests debugging purposes. Otherwise it will be hard to understand what was the conditions where the test failed.


fun waitUntil(
conditionDescription: String? = null,
timeoutMillis: Long = 5_000,
Copy link
Member

Choose a reason for hiding this comment

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

Let's convert it to Duration to have XXX.milliseconds outside for self-documentation

Copy link
Author

@ASalavei ASalavei Dec 12, 2025

Choose a reason for hiding this comment

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

Current API is already established - the function was moved here.

@igordmn igordmn removed their request for review December 15, 2025 14:22
@ASalavei ASalavei merged commit 3b48c4f into jb-main Dec 15, 2025
25 of 26 checks passed
@ASalavei ASalavei deleted the andrei.salavei/compose-view branch December 15, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants