Translating Kotlin to Swift didn’t go well • Kotlin/Native started to become stable enough at the time • Management was excited and skeptical at the same time How it all Started
language with type inference (Wikipedia) • JVM language originally • Open source including tooling • https://github.com/jetbrains/kotlin • Lots of similarities with Swift 7
• Objective-C as the “lowest common denominator” • limited generics • no default parameters • Some Kotlin is lost in translation • Works for us, YMMV 12 interface BookingStateStoreListener : StoreListener<BookingStoreState>
expect class Date() { val current: Long } // iOS source set import platform.Foundation.NSDate actual class Date actual constructor () { actual val current: Long get() = NSDate().timeIntervalSince1970().toMillis() } // Android source set actual class Date actual constructor() { actual val current: Long = System.currentTimeMillis() }
in one thread • delegate async processing to host platform • optionally freeze what you can & pass around • Wait a little more, proper coroutines are coming soon 19
language interop & multithreading implications on API design & implementation • Accessing platform services isn’t an issue • Be conscious what to share 20
• Deal with complex business domain by only having to translate it into the code once • Have a better shared understanding of the business • Deliver iOS app faster It may work for you as well! 23