Hi all, currently is there any issue regarding add...
# compose-ios
m
Hi all, currently is there any issue regarding adding @Composable annotation to some function inside some class in ios side? For example like this one:
Copy code
sealed interface UiMessage {

    data class Resource(val id: StringResource) : UiMessage
    data class Message(val message: String?) : UiMessage

    @Composable
    fun getMessage(): String {
        return when (this) {
            is Message -> this.message ?: ""
            is Resource -> stringResource(this.id)
        }
    }
}
Because in android side app works normally, but if I run this in ios side I get this error:
Copy code
e: There are still 1 unbound symbols after generation of IR module <shared>:
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: com.mmk.common.ui.util/UiMessage.getMessage|6304721183059763253[0]
When I remove @Composable annotation from function, this error goes away
s
Try making getMessage internal , or you can use @HiddenFromObjC annotation as well on getMessage composable
m
the thing is it was inside another common module, and it couldn't be internal. As a workaround I made it as a top level function
d
Yeah, we have some bugs with the compiler plugin on the native part of Compose. You can try to use workaround described here: https://github.com/JetBrains/compose-multiplatform/issues/3216#issuecomment-1570152305