Adam McDonald
03/26/2024, 1:39 PMcommon
which then translate to appropriate usages for Swift/iOS?
For example:
data class Measurement(val type:String, val value:Float)
fun Float.metres() = Measurement("Metre", this)
What I currently end up with being generated on the iOS side in the header file is given the extension function lives in the file `FloatExt.kt`:
__attribute__((objc_subclassing_restricted))
__attribute__((swift_name("FloatExtKt")))
@interface FloatExtKt : KotlinBase
+ (Measurement *)metres:(float)receiver __attribute__((swift_name("metres(_:)")));
@end
Which suggests that it’s not an extensions on the iOS “float” type but accessible via FloatExtKt.metres()
🤔Michael Krussel
03/26/2024, 1:44 PMtylerwilson
03/26/2024, 1:57 PM