Kotlin Multiplatform for iOS Developers (Lightning talk)
In this talk, we will check some tricks inside the incredible world of Kotlin Multiplatform for iOS. Kotlin Multiplatform Mobile (KMM) is an SDK that allows you to use the same business logic code in both iOS and Android applications.
Common iOS Android SharedCode/commonMain/kotlin SharedCode/iosMain SharedCode/androidMain/kotlin - iOS arm 64 or x86_64 JVM 1.6 Kotlin metadata Apple framework .jar file or .class files
Unit) { GlobalScope.launch(ApplicationDispatcher) { callback(model.getProducts()) } } getProducts{ (products: [Product]) #-> () in #// Do something here with product } iOS Call from Controller Suspend function in Kotlin Common suspend fun getProducts() {} Coroutine + Dispatcher
in self.listProduct = data self.tableView.reloadData() return KotlinUnit() }) actual fun createDb(): MyDatabase { val products = NativeSqliteDriver(MyDatabase.Schema, “products.db”) return MyDatabase(driver) }