The Kotlin/Swift boundary
September 27, 2021 5:40 PM 6:25 PM Online
Kotlin/Native can compile to Objective-C-compatible bytecode, but that doesn’t mean it looks natural to native iOS developers. While Kotlin and Swift are syntactically very similar, they solve certain problems in very different ways. For example, a Swift developer often uses a struct where a Kotlin developer uses a data class. This means the default ways that things translate from Kotlin through Objective-C into Swift don’t always come out looking idiomatic
We’ll talk through some of these differences, and strategies for dealing with them. Kotlin, Objective-C, and Swift are three different languages, and so we shouldn’t expect to be able to translate between them perfectly. But with a bit of care at the interop layer, we can make things a lot smoother in the iOS code.