Commit d84d12ae authored by jiangyh's avatar jiangyh

lib-airth支持ios端

parent e4ab1ed9
......@@ -34,6 +34,9 @@ kotlin {
val commonMain by getting
val iosMain by creating {
dependsOn(commonMain)
dependencies {
implementation(project(":lib-arith"))
}
}
val iosSimulatorArm64Main by getting {
......
package com.example.testdemo
import com.example.arith.Arith
fun iosUiText(): String {
val base = appInfo()
val add = Arith.add(7, 3)
val sub = Arith.sub(7, 3)
return "$base\nAdd is $add, Sub is $sub"
}
fun appInfoForIos(): String = appInfo()
......@@ -35,7 +35,7 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
C3BDEF052EFD07FA009E7973 /* Exceptions for "iosApp" folder in "Embed Frameworks" phase from "iosApp" target */ = {
C389BBDB2EFD167A007581B7 /* Exceptions for "iosApp" folder in "Embed Frameworks" phase from "iosApp" target */ = {
isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
attributesByRelativePath = {
ComposeApp.framework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
......@@ -57,7 +57,7 @@
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
BDD43DEBB46AE8B613E12CE8 /* Exceptions for "iosApp" folder in "iosApp" target */,
C3BDEF052EFD07FA009E7973 /* Exceptions for "iosApp" folder in "Embed Frameworks" phase from "iosApp" target */,
C389BBDB2EFD167A007581B7 /* Exceptions for "iosApp" folder in "Embed Frameworks" phase from "iosApp" target */,
);
path = iosApp;
sourceTree = "<group>";
......
......@@ -4,8 +4,8 @@ import ComposeApp // 对应 KMP 导出的 Framework 名
struct ContentView: View {
var body: some View {
VStack {
// 调用你刚修改的 appInfo()
Text(AppKt.appInfo())
let text = App_iosKt.iosUiText()
Text(text)
.multilineTextAlignment(.center)
.padding()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment