https://kotlinlang.org logo
j

John O'Reilly

08/03/2023, 4:05 PM
If using Compose for particular screens in otherwise SwiftUI based iOS app, what determines Material3 theme values when used in shared Compose code....just uses defaults?
👍 1
hacked together as a test but guess can do something like following
Copy code
fun SessionDetailsViewController(session: SessionDetails, socialLinkClicked: (String) -> Unit): UIViewController =
    ComposeUIViewController {
        val colorScheme = lightColorScheme(
            primary = Color(0xFF007AFF)
        )

        MaterialTheme(colorScheme = colorScheme) {
            SessionDetailViewShared(session, socialLinkClicked)
        }
    }
👍 1
👍🏻 1
d

Dima Avdeev

08/04/2023, 4:57 PM
Yes it uses default values as on Android and Desktop. And you can set them in MaterialTheme function.
5 Views