https://kotlinlang.org logo
#compose
Title
# compose
p

Piotr Krzemiński

10/29/2021, 2:09 PM
Hi! Does Compose support iOS? From what I see, it's just Android, desktop and web
🚫 7
🤞 2
f

Filip Wiesner

10/29/2021, 2:12 PM
Short answer: No 🙂 Other answers depend on what do you mean by "Compose". Compose Runtime? Compose UI?
☝️ 2
j

jw

10/29/2021, 2:19 PM
Compose Multiplatform* *but not really
😄 2
l

Luke

10/29/2021, 2:28 PM
Is it planned to bring Compose UI to iOS?
👍 1
p

Piotr Krzemiński

10/29/2021, 2:46 PM
@Filip Wiesner I don't know the difference, my mental model is that Compose is one thing :D what I exactly want to do is to use Compose API with Material components
Anyway, as Jake pointed out, it's a big surprise to me that something related to Mutliplarform and Kotlin doesn't support iOS. KMM does
f

Filip Wiesner

10/29/2021, 2:54 PM
If you want to use the whole Compose than the answer is "no". There is no official support for it. By Compose Runtime I mean the (non-UI) Compose framework that includes things like
State
, `CompositionLocal`s,
remember { }
etc. The reason it's different is that Runtime is multiplatform and UI is platform specific*.* (And there are several "UI frameworks" built on Compose Runtime)
🙏 1
p

Piotr Krzemiński

10/29/2021, 3:00 PM
Thanks! I'll check how far I can go with this knowledge, and I'll probably also file a feature request to have full iOS support, so that we can have platform-agnostic code that uses Material UI
f

Filip Wiesner

10/29/2021, 3:07 PM
I think there are some experiments with iOS Compose UI by JetBrains already 😉
j

jw

10/29/2021, 3:56 PM
We have had Compose working on iOS for about 5 months now targeting UIKit. Our usage is even more complicated because it's truly multiplatform in that it works on every platform Kotlin supports and it allows you to bring the UI toolkit implementation while still code sharing the presenter-like logic that Compose lets you write.
👍 2
👏🏼 3
👏 4
c

CLOVIS

10/29/2021, 4:21 PM
@jw is that publicly available? I'm very interested how you managed to keep all the Compose goodness as well as allowing platform-specific UIs (I'm currently struggling through trying to have a multiplatform Modifier implementation)
j

jw

10/29/2021, 4:22 PM
Not yet, but it's built in its own repo with the goal of open sourcing.
👍 2
🚀 1
c

CLOVIS

10/29/2021, 4:24 PM
That's amazing! Do you have a (rough) estimate to when it'll become public?
j

jw

10/29/2021, 4:49 PM
Maybe Spring.
🤞 12
c

CLOVIS

10/29/2021, 7:14 PM
Ah, that's quite a long time away. Well, at least we know someone is seriously working on it 👍
j

jw

10/30/2021, 12:38 AM
Two months of paternity leave starts in 16 days 😁
👍 5
🎉 8
💯 2
Otherwise it might be sooner
c

CLOVIS

10/30/2021, 11:44 AM
Oh! Congrats, that's a great reason 🤣
m

mcpiroman

10/30/2021, 3:04 PM
Sounds great, but does both your and JB's team knew of each others' affords?
j

jw

11/03/2021, 12:54 AM
Well they helped us get Compose running on iOS ~6 months ago. But they seem to want to port Compose UI to native. And we want nothing to do with Compose UI on JVM, web, or native platforms.
c

CLOVIS

11/04/2021, 3:29 PM
@jw does that mean that your version does multiplatform without Compose UI (eg. Reimplemented all composables for these platfoms)? If so, and it can still easily do multiplatform, that sounds amazing
j

jw

11/04/2021, 3:48 PM
We have our own set of composables and rendering, yes. But they are shared across all platforms it's just not necessarily the same rendering on all platforms
c

CLOVIS

11/05/2021, 9:26 PM
I see, same API but different implementation. Are the different implementations pixel-perfectly identical, or are you more following a ‘it must broadly look the same but each platform is allowed small differences so it fits better with the overall system look’ style?
I really wish the latter was possible, but I'm worried there's a conflict between ‘multiplatform UI code’ and ‘enough control that it feels like a native app everywhere’. I'd be very impressed if both of these goals can be reached by the same library.
j

jw

11/05/2021, 11:43 PM
The implementations do not look the same. We only care about consistency insofar as the design system commands. Beyond that, controls like switches are themed with our brand but match the look and feel of the platform.
c

CLOVIS

11/06/2021, 8:23 AM
Honestly that sounds like a dream come true.
👌 1
b

Brian G

11/08/2021, 3:08 PM
I think both options have their place. Perhaps JB is interested in both for iOS as well?
I like how they are aproaching Compose Web, JetBrains is supporting web components (html/css) but also working on a multiplatform-canvas alternative using Compose UI. Both have their use...
Having both options on iOS would be great, too (Composable UIKit + Compose UI).
👍 2
c

CLOVIS

11/09/2021, 5:34 AM
Both have their use, but I'm worried about interoperability between Compose for web DOM and Compose for web Canvas
i

ivano

11/19/2021, 10:23 PM
Thanks. Finally one language for everything and no excuses to not focus on algo and math
4 Views