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
Sunil Kumar
06/03/2023, 3:48 AM
Try making getMessage internal , or you can use @HiddenFromObjC annotation as well on getMessage composable
m
Mirzamehdi
06/03/2023, 5:00 PM
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