The document discusses Kotlin Multiplatform and how it allows sharing code across platforms like Android, iOS, JVM and JavaScript. It explains that Kotlin Multiplatform uses expected and actual declarations to abstract platform-specific code and share common code. While promising for code reuse, it cautions that Kotlin Multiplatform is still alpha and may not be ready for all production environments depending on the specific needs and platform integration required. Developers are advised to communicate with platform teams.
5. tf
orm
[1] How it works
[2] How to handle pla
tf
orm speci
fi
c library or SDK
[3] Conclusion : Is it ready for production?
6. index
[0] What is Kotlin Multipla
tf
orm
[1] How it works
[2] How to handle pla
tf
orm speci
fi
c library or SDK
[3] Conclusion : Is it ready for production?
17. android ios server web
commonMain
androidMain iosMain serverMain webMain
shared
expected
actual
18. android ios server web
commonMain
androidMain iosMain serverMain webMain
shared
expected
actual
19. android ios server web
commonMain
androidMain iosMain serverMain webMain
shared
expected
actual
20. expect fun getPlatformName(): String
// commonMain
actual fun getPlatformName() = “iOS"
// iosMain
actual fun getPlatformName() = “Android”
// androidMain
21. expect fun getPlatformName(): String
// commonMain
actual fun getPlatformName() = “iOS"
// iosMain
actual fun getPlatformName() = “Android”
// androidMain
22. expect fun getPlatformName(): String
// commonMain
actual fun getPlatformName() = “iOS"
// iosMain
actual fun getPlatformName() = “Android”
// androidMain
28. Kotlin Swift
interface protocol
constructor/ create Initializer
suspend -> completionHandler:
@Throws fun throws
companion member <- Class method or property
null nil
Unit return type Void
String NSMutableString
List Array
MutableList NSMutableArray
MutableSet NSMutableSet
Map Dictionary
MutableMap NSMutableDictionary
Mapping
39. so… Is it ready for production?
I think yes. but it is alpha
Depends on development environment & rules
Should communicate with each pla
tf
orm developers
in Qanda...?