abatutin
07/19/2017, 10:54 AMsvyatoslav.scherbina
07/19/2017, 11:17 AMCPointer<...>
)?abatutin
07/19/2017, 11:37 AMfun test() {
println("Hello, World!")
}
abatutin
07/19/2017, 11:37 AMabatutin
07/19/2017, 11:37 AMsvyatoslav.scherbina
07/19/2017, 12:04 PMmain
function to Kotlin Native part, and call your true main
from it. In this case Objective-C/Swift part should be compiled into static library and supplied to Kotlin compiler through -linkerOpts
.
Then, to call Kotlin function from Objective-C you can either
1) Export the function from Kotlin with internal annotation @konan.internal.ExportForCppRuntime(<name>)
and import it in Objective-C by declaring it as usual C function,
or
2) Pass Kotlin functions to Objective-C as pointers using staticCFunction
.svyatoslav.scherbina
07/19/2017, 12:06 PMabatutin
07/19/2017, 12:08 PMabatutin
07/19/2017, 1:17 PMstaticCFunction
worked, thnxabatutin
07/19/2017, 1:18 PMsvyatoslav.scherbina
07/19/2017, 2:05 PMabatutin
07/19/2017, 2:20 PM