Skip to content

UIView-based Compose integration API#2589

Merged
Andrei Salavei (ASalavei) merged 22 commits into
jb-mainfrom
andrei.salavei/compose-view
Dec 15, 2025
Merged

UIView-based Compose integration API#2589
Andrei Salavei (ASalavei) merged 22 commits into
jb-mainfrom
andrei.salavei/compose-view

Conversation

@ASalavei

@ASalavei Andrei Salavei (ASalavei) commented Nov 24, 2025

Copy link
Copy Markdown
  • 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 Andrei Salavei (ASalavei) changed the title Andrei.salavei/compose view Introduce UIView-based Compose integration API Nov 24, 2025
@ASalavei Andrei Salavei (ASalavei) changed the title Introduce UIView-based Compose integration API UIView-based Compose integration API Nov 24, 2025
Comment on lines +21 to +23
/**
* Base configuration of the Compose container.
*/

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator

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

@ASalavei Andrei Salavei (ASalavei) Dec 12, 2025

Copy link
Copy Markdown
Author

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.

Comment thread compose/ui/ui/api/ui.klib.api
@igordmn Igor Demin (igordmn) removed their request for review December 15, 2025 14:22
@ASalavei Andrei Salavei (ASalavei) merged commit 3b48c4f into jb-main Dec 15, 2025
25 of 26 checks passed
@ASalavei Andrei Salavei (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