๐๐ ๐ฃ - ๐๐ผ๐ ๐๐ผ ๐๐๐ฎ๐ฟ๐ ๐๐ต๐ฎ๐ฟ๐ถ๐ป๐ด ๐ฐ๐ผ๐ฑ๐ฒ ๐ถ๐ป ๐ฒ๐
๐ถ๐๐๐ถ๐ป๐ด ๐๐ป๐ฑ๐ฟ๐ผ๐ถ๐ฑ/๐๐ข๐ฆ ๐ฎ๐ฝ๐ฝ๐ ?
Most companies don't start Kotlin Multiplatform greenfield. They have an existing Android repo and an existing iOS repo, both already shipping, and the real question is: how do you share logic without merging them or rewriting either one?
Built a working demo: extracted a loan EMI calculator that existed twice, once in Kotlin and once in Swift, and moved it into its own small Kotlin Multiplatform module; it had been quietly able to drift out of sync.
Published it in two ways: JitPack for the Android repo, and a Swift Package pointing at a released XCFramework for the iOS repo. Neither app repo touches the other's code.
81 lines of duplicated logic gone (37 Kotlin + 44 Swift), replaced with one 67-line shared implementation both platforms now depend on. Verified identical output across 7 test cases 100% match, checked with a real Gradle test run against the JitPack artifact and a real xcodebuild test run against the SPM-resolved XCFramework, not just claimed.
Full before/after + step-by-step migration guide in the repo.
๐ Shared module:
https://github.com/ranab4b/kmp-shared-business-logic
๐ Before/after demo + migration guide:
https://github.com/ranab4b/kmp-adoption-before-after