https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Daniele B

02/14/2023, 5:20 PM
what is the best way to know inside the common code which is the running platform (e.g. Android, iOS, Destkop, etc.)?
e

ephemient

02/14/2023, 5:22 PM
Copy code
// commonMain/platform.kt
expect val platform: String
// androidMain/platform.kt
actual val platform: String = "android"
// etc.
d

Daniele B

02/14/2023, 5:22 PM
thanks!
2 Views