https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
m

Michael Paus

07/29/2022, 11:48 AM
Is it possible to write an iOS app with Compose where the GUI is done natively with SwiftUI but all application graphics is done via the Compose Canvas? I.e., is it possible to mix SwiftUI with Compose Canvas rendering?
a

Anthony Martin

07/29/2022, 11:59 AM
Nah, but you could create a Kotlin MPP library to host all of your logic and then write android UI in Compose & iOS UI in SwiftUI
d

darkmoon_uk

07/29/2022, 12:16 PM
☝️ Have done this in production
m

Michael Paus

07/29/2022, 12:33 PM
@Anthony Martin Well, I think that wouldn’t help me much. If most of my logic is around creating graphics I would have to create an abstract canvas interface that I could then use in Compose or SwiftUI and this is exactly what I would like to avoid because it would be an enormous amount of work.
d

darkmoon_uk

07/29/2022, 12:43 PM
Yes the latter, deployed a production App on iOS with SwiftUI and on Android with Compose, sharing all other logic. That may be less helpful to know for you though; I'm not aware of a way to mix the two on the same screen.
Multiple iOS Windows may work technically but be of limited practical use.
l

Landry Norris

07/29/2022, 12:44 PM
View interop could potentially be part of the stable release of #compose-ios, since it’s in the other platforms. Keep in mind #compose-ios is not done yet.
I remember there being a commit when they added keyboard support that removed the line in SkikoUIView that sets the frame to match the window size. It may be possible to use a SkikoUIView similar to ComposeView on Android. I haven’t tested this out yet.
m

Michael Paus

07/29/2022, 3:35 PM
Thank you all. I’ll keep an eye on that.
d

Dima Avdeev

07/29/2022, 8:23 PM
We plan to make samples to interop with UIKit and SwiftUI. But at current time, we have another priorities.
a

Anthony Martin

07/29/2022, 8:24 PM
Hoping for an alpha release soon 👀
d

Dima Avdeev

07/29/2022, 8:27 PM
For now we are doing better TextField's experience. And next we have a lot of another features, need to be implemented.
l

Landry Norris

07/29/2022, 8:27 PM
I wrote a library a while back that could render a UIView onto an iOS composable (can’t promise efficiency, and it didn’t handle re-rendering well at the time). I made a little bit of progress before shifting to another side project. Is there anything I could contribute to potentially speed up platform view integration?
a

Anthony Martin

07/29/2022, 8:27 PM
Do you have a roadmap for compose at all? Be interesting to see where compose for iOS fits in and expected alpha builds that we can play around with.
d

Dima Avdeev

07/29/2022, 8:31 PM
@Landry Norris It's cool, if someone can prepare little samples to interop with SwiftUI and UIKit. I think, very basic samples already can help's.
@Anthony Martin We don't have public roadmap yet, because it's hard to predict current speed of development. But we have the desire and support of the community 🙂
h

hfhbd

07/31/2022, 9:46 AM
@Dima Avdeev I think, many people do support compose and would like to contribute more often. So it would be great if the roadmap could be public and you would have some better process/feedback for PRs to accelerate Compose!
d

Dima Avdeev

07/31/2022, 12:12 PM
@hfhbd Yeah, thanks for advice! We will try to make this process better!
41 Views