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

EnricCamarero

06/20/2019, 10:41 AM
Hi fellows! I’m using the Cocoapods integration with Kotlin Mpp. Everything works great except not all methods get converted to my .framework file. Do you know what is going on? Is this a bug or a feature? Here goes my Kotlin class and the .h file generated:
Copy code
__attribute__((swift_name("Repository")))
@protocol DomainRepository
@required
- (DomainResult *)getDataSync __attribute__((swift_name("getDataSync()")));
@end;
Copy code
interface Repository {
    suspend fun getData(): Result<List<Song>>
    fun getDataSync() : Result<List<Song>>
}
m

marstran

06/20/2019, 10:42 AM
Triple backticks (```) for code blocks 😉
e

EnricCamarero

06/20/2019, 10:43 AM
thnks! 😉
k

kpgalligan

06/20/2019, 10:45 AM
suspend I would assume is the issue
r

ribesg

06/20/2019, 10:59 AM
You obviously can’t use coroutines in ObjC/Swift
l

louiscad

06/20/2019, 11:48 AM
You need to write bridge code to use callbacks (beware of handling cancellation properly)
8 Views