I'm having some trouble implementing a koltin inte...
# touchlab-tools
s
I'm having some trouble implementing a koltin interface in Swift. I'm using kmmbridge with skie to package the kmm module and using SPM to import the package. I've implemented the same interface (same module with kmmbridge and skie) in another project that uses cocoapods successfully, and then I've tried to copy that implementation to my new project that is using kmmbridge but still getting an error that my class does not conform to the protocol. Not sure why I'm seeing this error or how to fix it. Can anyone give some guidance on what I might be missing?
i should note that I used the
native.cocoapods
plugin for cocoapods and not kmmbridge. I'll try out the kmmbridge cocoapods soon to check if I can implement the interface with that packaging
so it looks like I'm having the issues only when I have a function parameter that is a
data class
. for example, I have
Copy code
data class Foo(val name: String)

interface Bar {
    fun getBar(foo: Foo)
}
and when I try to implement this interface in swift when using kmmbridge, I get the error about not conforming to the protocol. If I change the parameter type or remove the function, then things work as expected. And like I mentioned, if I use cocoapods to package the kotlin code, then I am able to use data classes as function parameter types. Is this a bug or is there a workaround?
even if I change the
data class
to just a
class
, I still see the issue
ok so one of the interfaces I was having issues actually just had a naming collision with a class in the swift sources. i have another interface that is also having issues but having figured out what the problem is. it also happens to have a function with a data class as a param but it's not clear that is an issue