Pavel Lahoda
12/06/2023, 9:18 AMfun foo(classType: KType)
which maps on iOS to KotlinType. This is not mentioned in https://kotlinlang.org/docs/native-objc-interop.html and I don't know how to convert Swift/Obj-c class type to KotlinType.Jan Holešovský
12/06/2023, 9:35 AMJan Holešovský
12/06/2023, 9:39 AMPavel Lahoda
12/06/2023, 11:21 AMannotation class Feature(
val featureId: KClass<out Identificator>
)
that I use to mark my multiplatform objects and then on the client I should be able to get this object using getByFeature(feature: Identificator)
I found a kind of ugly workaround I will have a function:
fun getByFeature(identifier: Any)
And I will have to pass an instance of type. In the shared code will compare the class like this:
var feature = features.firstOrNull {
if (it.identifier != null) {
it.identifier!!::class.qualifiedName == identifiedBy::class.qualifiedName
}
false
}
Don't like the need to create the instance, but still have no idea how to pass type as parameterJan Holešovský
12/06/2023, 3:48 PMPavel Lahoda
12/06/2023, 3:49 PMfun getByFeature(identifier: Any)
This is an API that would get called from the iOS (Swift). I need to pass the type as a parameter. Both are defined in KMP, but call actually happens on the clientJan Holešovský
12/06/2023, 3:58 PMJan Holešovský
12/06/2023, 4:05 PMPavel Lahoda
12/06/2023, 4:07 PMJan Holešovský
12/06/2023, 4:11 PMPavel Lahoda
12/06/2023, 4:17 PMJan Holešovský
12/06/2023, 4:30 PMPavel Lahoda
12/06/2023, 4:32 PMJan Holešovský
12/06/2023, 4:33 PMJan Holešovský
12/06/2023, 4:37 PMannotation class Blah(val xx: XYZ = XYZ.A) {
enum class XYZ { A, B, C }
}
Pavel Lahoda
12/06/2023, 4:41 PM