https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Anonymike

03/16/2023, 12:20 AM
Hi there everyone. Question regarding a Kotlin class property being inaccessible in Swift: I have a Kotlin Multiplatform API that we use in a Kotlin Multiplatform project and in the Swift code for this project I'm working with one of our classes ("ConversationMessageItem", a data class with simple string and numeric properties). I can access every single property except the "id" property in Swift. I get an error message "Value of type ConversationMessageItem has no member 'id'". All of these properties were published at the same time and if I log the class and let toString() be called via logging in Swift, sure enough the id value outputs with the other properties in the data class toString interpolation, so I know its there, but compilation does not succeed if I reference the property at all. Has anyone had this happen before or know why it may be happening? Thank you in advance for any help you can offer.
6 Views