How does Compose Multiplatform render UI on iOS?

346 Views Asked by At

I know that Flutter renders the UI on a native canvas completely controlled by the Flutter run time. In React Native, it translates to the native UI via a bridge and renders native components.

How does Compose Multiplatform render the UI on iOS? Does it translate to the native UI (SwiftUI) or does it still use a canvas that's completely controlled by the Compose runtime and draw directly on it?

1

There are 1 best solutions below

0
On

Compose Multiplatform uses the canvas and draws directly to the screen. That is obviously similar to Flutter.

So, why not Flutter?

  • Android UI is fully "native" as far as Compose being the recommended UI system to use. You'd likely write you UI with Compose anyway.
  • You can blend Compose UI views and SwiftUI in the same app, and the same screen, and share your underlying "view model" code. Screens written in Compose UI on iOS can be incrementally "refaced" with SwiftUI.

It is also possible to drive SwiftUI with a shared Compose DSL. We have done some experiments with this. However, that would take significant work to develop a usable common Compose DSL.