function in Kotlin. I tested its feasibility and by using
@ObjCName("callAsFunction")
I’m able to achieve that behavior.
Is there a way to declare an annotation that applies the ObjCName renaming to the annotated function? I thought that this would have worked but it didn’t…
Copy code
@OptIn(ExperimentalObjCName::class)
@ObjCName("callAsFunction")
annotation class SwiftCallAsFunction
my goal is to avoid to repeat the
"callAsFunction"
string everywhere is needed. I thought about using a constant but I would like to understand if there are other ways
thanks!
🍿 1
➕ 1
e
Edoardo Luppi
11/06/2023, 2:44 PM
No it won't work. You need a compiler plugin.
But keep it simple.
j
juliocbcotta
11/06/2023, 6:13 PM
Maybe it's something that the folks at #touchlab-tools can help?