Kotlin IOS/Android Mutliplatform 动手教程:未解决的参考:平台

Clé*_*lon 6 android ios kotlin kotlin-multiplatform

我正在尝试学习如何使用 Kotlin 进行 IOS/Android 多平台开发。

在进行实践教程时,请访问: https: //play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/03_CreatingSharedCode

Unresolved reference: platform我在文件 SharedCode/src/iosMain/kotlin/actual.kt 中收到错误:

package com.jetbrains.handson.mpp.mobile
import platform.UIKit.UIDevice

actual fun platformName(): String{
    return UIDevice.currentDevice.systemName() +
            " " +
            UIDevice.currentDevice.systemVersion
}
Run Code Online (Sandbox Code Playgroud)

它只适用于 MacOS 还是我遗漏了一些东西?

感谢您的帮助。