Sylvain Patenaude
01/31/2020, 4:28 PMswift_name
? And why do I see objc_subclassing_restricted
?
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("SomeHelperKt")))
@interface ProjectNameSomeHelperKt : KotlinBase
Artyom Degtyarev [JB]
02/03/2020, 8:01 AM*Kt
suffix is used for top-level functions and variables, so it should not appear on objects. Subclassing is described here (https://github.com/JetBrains/kotlin-native/blob/master/OBJC_INTEROP.md#subclassing-kotlin-classes-and-interfaces-from-swiftobjective-c).Sylvain Patenaude
02/03/2020, 4:56 PMobject SomeHelper {
fun someFunction1(): Array<String> {
return arrayOf("some string 1", "some string 2")
}
@ExperimentalUnsignedTypes
@ExperimentalStdlibApi
fun someFunction2(array: UByteArray): SomeDataClass {
...
...
return SomeDataClass("string 3", "string 4", 200u, 200u)
}
}
Sylvain Patenaude
02/03/2020, 9:04 PMobject
with only 1 function and it generated the correct/expected name. I wonder if the fact that I use attributes such @ExperimentalUnsignedTypes and @ExperimentalStdlibApi in my `object`s alter the names generated, and if so, if there's a way to counter this.
I'll keep experimenting, but if someone has a solution, let me know.Sylvain Patenaude
02/03/2020, 10:11 PMSylvain Patenaude
02/04/2020, 7:57 PM