Umesh Gupta
01/31/2024, 2:18 PMfun static sendToTailor(name : String)
. I need to call this method in IOS main of KMM, how can I do that ?streetsofboston
01/31/2024, 2:52 PM@objc
annotation in your swift code should suffice for swift to write all the necessary wrappers.Umesh Gupta
01/31/2024, 5:01 PMimport Foundation
@objc class TailorBridge: NSObject {
@objc static func sendToTailor(name: String, payload: [String: Any]) {
print("Name: \(name), Value: \(payload)")
}
}
actual object TailorBridge {
actual fun sendToTailor(
name: String,
payload: Map<String, Any>
) {
val nsDictionary = payload.toNSDictionary()
TailorBridge().sendToTailor(name, nsDictionary)
}
}
But in actual its not able to resolveUmesh Gupta
01/31/2024, 5:03 PMError -> error: Unresolved reference:
streetsofboston
01/31/2024, 5:40 PM@objc
annotations. You'll still need to add and configure KMP's cinterop functionality so that these Obj-C wrappers are visible/accessible by KMP.streetsofboston
01/31/2024, 6:57 PMUmesh Gupta
02/02/2024, 4:38 PM