Commit d84d12ae authored by jiangyh's avatar jiangyh

lib-airth支持ios端

parent e4ab1ed9
...@@ -34,6 +34,9 @@ kotlin { ...@@ -34,6 +34,9 @@ kotlin {
val commonMain by getting val commonMain by getting
val iosMain by creating { val iosMain by creating {
dependsOn(commonMain) dependsOn(commonMain)
dependencies {
implementation(project(":lib-arith"))
}
} }
val iosSimulatorArm64Main by getting { val iosSimulatorArm64Main by getting {
......
package com.example.testdemo 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() fun appInfoForIos(): String = appInfo()
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet 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; isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
attributesByRelativePath = { attributesByRelativePath = {
ComposeApp.framework = (CodeSignOnCopy, RemoveHeadersOnCopy, ); ComposeApp.framework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
isa = PBXFileSystemSynchronizedRootGroup; isa = PBXFileSystemSynchronizedRootGroup;
exceptions = ( exceptions = (
BDD43DEBB46AE8B613E12CE8 /* Exceptions for "iosApp" folder in "iosApp" target */, 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; path = iosApp;
sourceTree = "<group>"; sourceTree = "<group>";
......
...@@ -4,8 +4,8 @@ import ComposeApp // 对应 KMP 导出的 Framework 名 ...@@ -4,8 +4,8 @@ import ComposeApp // 对应 KMP 导出的 Framework 名
struct ContentView: View { struct ContentView: View {
var body: some View { var body: some View {
VStack { VStack {
// 调用你刚修改的 appInfo() let text = App_iosKt.iosUiText()
Text(AppKt.appInfo()) Text(text)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
.padding() .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