Damiano Giusti
11/06/2023, 2:39 PMcallAsFunction
operator in Swift like the operator fun invoke
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…
@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!Edoardo Luppi
11/06/2023, 2:44 PMjuliocbcotta
11/06/2023, 6:13 PMDamiano Giusti
11/07/2023, 9:23 AM