From 1eacad0e78fb1d3ab2c8861cb7528b81bfb5d26b Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Fri, 11 Apr 2025 13:53:03 +0700 Subject: [PATCH 01/12] #54 fixed fields list validation --- .../kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt b/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt index 99fd632..23e1868 100644 --- a/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt +++ b/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt @@ -4,5 +4,6 @@ package dev.icerock.moko.fields.core -fun List>.validate(): Boolean = - all { it.validate() } +fun List>.validate(): Boolean { + return map { it.validate() }.all { true } +} From f613b1a1d7ec103a341275a7da1dfd8ee3f0ed1a Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Fri, 11 Apr 2025 13:56:07 +0700 Subject: [PATCH 02/12] #54 upgrade to 0.13.0 --- README.md | 8 ++++---- gradle/libs.versions.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cdf4c07..6d4eb26 100755 --- a/README.md +++ b/README.md @@ -37,13 +37,13 @@ allprojects { project build.gradle ```groovy dependencies { - commonMainApi("dev.icerock.moko:fields-core:0.12.0") + commonMainApi("dev.icerock.moko:fields-core:0.13.0") // integration with reactive flows - commonMainApi("dev.icerock.moko:fields-livedata:0.12.0") - commonMainApi("dev.icerock.moko:fields-flow:0.12.0") + commonMainApi("dev.icerock.moko:fields-livedata:0.13.0") + commonMainApi("dev.icerock.moko:fields-flow:0.13.0") - androidMainApi("dev.icerock.moko:fields-material:0.12.0") + androidMainApi("dev.icerock.moko:fields-material:0.13.0") } ``` diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c0e8bed..b52aa56 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ coroutinesVersion = "1.6.4" mokoResourcesVersion = "0.21.2" mokoMvvmVersion = "0.16.0" mokoTestVersion = "0.6.1" -mokoFieldsVersion = "0.12.0" +mokoFieldsVersion = "0.13.0" [libraries] # android From 3199c0cf43afd96b447b86222f4029bd1b1ef122 Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Fri, 11 Apr 2025 14:12:42 +0700 Subject: [PATCH 03/12] #54 fixed validation --- .../kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt b/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt index 23e1868..d59702e 100644 --- a/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt +++ b/fields-core/src/commonMain/kotlin/dev/icerock/moko/fields/core/FormFieldExt.kt @@ -5,5 +5,5 @@ package dev.icerock.moko.fields.core fun List>.validate(): Boolean { - return map { it.validate() }.all { true } + return map { it.validate() }.all { it } } From 88f1c480ffd7475487a26c6be2aa1888d39c585b Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Mon, 14 Apr 2025 10:14:52 +0700 Subject: [PATCH 04/12] #54 downgrade version for ci check --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b52aa56..c0e8bed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ coroutinesVersion = "1.6.4" mokoResourcesVersion = "0.21.2" mokoMvvmVersion = "0.16.0" mokoTestVersion = "0.6.1" -mokoFieldsVersion = "0.13.0" +mokoFieldsVersion = "0.12.0" [libraries] # android From 02c190e020eeac0383bf0efd8a199d33fa3e6c39 Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 11:25:05 +0700 Subject: [PATCH 05/12] #54 downgrade xcode, update lib version, added .kotlin in ignore --- .github/workflows/compilation-check.yml | 6 ++++++ .gitignore | 1 + gradle/libs.versions.toml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index a85499f..c1184c6 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -16,6 +16,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + - name: Set Xcode version to 15.3 + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.3' + - name: Print Xcode version + run: xcodebuild -version - name: Check build run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64 - name: Install pods diff --git a/.gitignore b/.gitignore index 2a11f92..1d2381e 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle +.kotlin .settings .project .classpath diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c0e8bed..b52aa56 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ coroutinesVersion = "1.6.4" mokoResourcesVersion = "0.21.2" mokoMvvmVersion = "0.16.0" mokoTestVersion = "0.6.1" -mokoFieldsVersion = "0.12.0" +mokoFieldsVersion = "0.13.0" [libraries] # android From aa8f0286a9bbde302d111460675c3efc165f6765 Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 11:45:53 +0700 Subject: [PATCH 06/12] #54 downgrade ci to xcode 15.2 --- .github/workflows/compilation-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index c1184c6..17af9be 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -16,10 +16,10 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Set Xcode version to 15.3 + - name: Set Xcode version to 15.2 uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.3' + xcode-version: '15.2' - name: Print Xcode version run: xcodebuild -version - name: Check build From dab1b0ae24e85eabb6179eeff37a09131024bef0 Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 12:00:09 +0700 Subject: [PATCH 07/12] #54 xcode 14.3.1 --- .github/workflows/compilation-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index 17af9be..e7fcf66 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -16,10 +16,10 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Set Xcode version to 15.2 + - name: Set Xcode version to 14.3.1 uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.2' + xcode-version: '14.3.1' - name: Print Xcode version run: xcodebuild -version - name: Check build From ed11b86b9552a9e74ad4e3c05b218b8e5e363d1a Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 12:05:20 +0700 Subject: [PATCH 08/12] #54 check linker --- .github/workflows/compilation-check.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index e7fcf66..ec05efd 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -16,15 +16,19 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Set Xcode version to 14.3.1 + - name: Set Xcode version to 15.0.1 uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '14.3.1' + xcode-version: '15.0.1' - name: Print Xcode version run: xcodebuild -version + - name: Show used Ld version + run: xcrun -sdk iphonesimulator -find ld - name: Check build run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64 - name: Install pods run: cd sample/ios-app && pod install - name: build ios sample run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty + env: + GRADLE_OPTS: -Dkotlin.native.linkerOpts=-ld_classic From 929d9bdba2aaf877b3f0477b580cbbe29d948070 Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 23:37:38 +0700 Subject: [PATCH 09/12] #54 update samples, gradle plugin, gradle agp --- .github/workflows/compilation-check.yml | 8 -------- gradle/libs.versions.toml | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 3 ++- sample-declarative-ui/androidApp/build.gradle.kts | 13 ++++++++++--- .../androidApp/src/main/AndroidManifest.xml | 6 ++---- sample-declarative-ui/shared/build.gradle.kts | 15 +++++++++++---- .../shared/src/androidMain/AndroidManifest.xml | 2 -- .../fields/sample/declarativeui/LoginViewModel.kt | 1 + .../MR => moko-resources}/base/strings.xml | 0 sample/mpp-library/build.gradle.kts | 7 ++++++- .../MR => moko-resources}/base/strings.xml | 0 settings.gradle.kts | 1 - 12 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 sample-declarative-ui/shared/src/androidMain/AndroidManifest.xml rename sample-declarative-ui/shared/src/commonMain/{resources/MR => moko-resources}/base/strings.xml (100%) rename sample/mpp-library/src/commonMain/{resources/MR => moko-resources}/base/strings.xml (100%) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index ec05efd..19367b3 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -16,19 +16,11 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 - - name: Set Xcode version to 15.0.1 - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.0.1' - name: Print Xcode version run: xcodebuild -version - - name: Show used Ld version - run: xcrun -sdk iphonesimulator -find ld - name: Check build run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64 - name: Install pods run: cd sample/ios-app && pod install - name: build ios sample run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty - env: - GRADLE_OPTS: -Dkotlin.native.linkerOpts=-ld_classic diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b52aa56..e25865a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlinVersion = "1.8.10" +kotlinVersion = "1.9.10" # android androidAppCompatVersion = "1.6.1" @@ -10,7 +10,7 @@ androidLifecycleVersion = "2.6.1" coroutinesVersion = "1.6.4" # moko -mokoResourcesVersion = "0.21.2" +mokoResourcesVersion = "0.24.5" mokoMvvmVersion = "0.16.0" mokoTestVersion = "0.6.1" mokoFieldsVersion = "0.13.0" @@ -41,7 +41,7 @@ mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersi # gradle plugins kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" } -androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" } +androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.2.1" } mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" } -mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" } +mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.2" } mokoKSwiftGradlePlugin = { module = "dev.icerock.moko:kswift-gradle-plugin", version = "0.6.1" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..00077cd 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Tue Apr 15 22:30:14 KRAT 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample-declarative-ui/androidApp/build.gradle.kts b/sample-declarative-ui/androidApp/build.gradle.kts index 1ae686e..77e7b4c 100644 --- a/sample-declarative-ui/androidApp/build.gradle.kts +++ b/sample-declarative-ui/androidApp/build.gradle.kts @@ -8,14 +8,14 @@ plugins { } android { - compileSdk = 33 + compileSdk = 34 buildFeatures { compose = true } defaultConfig { applicationId = "dev.icerock.moko.fields.sample.declarativeui.android" minSdk = 21 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" } @@ -25,7 +25,14 @@ android { } } composeOptions { - kotlinCompilerExtensionVersion = "1.4.4" + kotlinCompilerExtensionVersion = "1.5.15" + } + + namespace = "dev.icerock.sample.declarativeui.android" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } } diff --git a/sample-declarative-ui/androidApp/src/main/AndroidManifest.xml b/sample-declarative-ui/androidApp/src/main/AndroidManifest.xml index dd51cf2..9e6e5b4 100644 --- a/sample-declarative-ui/androidApp/src/main/AndroidManifest.xml +++ b/sample-declarative-ui/androidApp/src/main/AndroidManifest.xml @@ -1,7 +1,5 @@ - + diff --git a/sample-declarative-ui/shared/build.gradle.kts b/sample-declarative-ui/shared/build.gradle.kts index 4b3586c..7c17bdd 100644 --- a/sample-declarative-ui/shared/build.gradle.kts +++ b/sample-declarative-ui/shared/build.gradle.kts @@ -18,7 +18,7 @@ val dependenciesList = listOf( ) kotlin { - android() + androidTarget() val xcf = XCFramework("MultiPlatformLibrary") listOf( @@ -75,15 +75,22 @@ kotlin { } multiplatformResources { - multiplatformResourcesPackage = "dev.icerock.moko.fields.sample.declarativeui" + resourcesPackage.set("dev.icerock.moko.fields.sample.declarativeui.shared") } android { - compileSdk = 32 + compileSdk = 34 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") defaultConfig { minSdk = 21 - targetSdk = 32 + targetSdk = 34 + } + + namespace = "dev.icerock.sample.declarativeui.shared" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } } diff --git a/sample-declarative-ui/shared/src/androidMain/AndroidManifest.xml b/sample-declarative-ui/shared/src/androidMain/AndroidManifest.xml deleted file mode 100644 index 4350a79..0000000 --- a/sample-declarative-ui/shared/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/sample-declarative-ui/shared/src/commonMain/kotlin/dev/icerock/moko/fields/sample/declarativeui/LoginViewModel.kt b/sample-declarative-ui/shared/src/commonMain/kotlin/dev/icerock/moko/fields/sample/declarativeui/LoginViewModel.kt index 9c2a7cb..eca0f06 100644 --- a/sample-declarative-ui/shared/src/commonMain/kotlin/dev/icerock/moko/fields/sample/declarativeui/LoginViewModel.kt +++ b/sample-declarative-ui/shared/src/commonMain/kotlin/dev/icerock/moko/fields/sample/declarativeui/LoginViewModel.kt @@ -14,6 +14,7 @@ import dev.icerock.moko.fields.core.validations.notBlank import dev.icerock.moko.fields.flow.FormField import dev.icerock.moko.fields.flow.flowBlock import dev.icerock.moko.fields.flow.validations.fieldValidation +import dev.icerock.moko.fields.sample.declarativeui.shared.MR import dev.icerock.moko.mvvm.flow.CFlow import dev.icerock.moko.mvvm.flow.cFlow import dev.icerock.moko.mvvm.viewmodel.ViewModel diff --git a/sample-declarative-ui/shared/src/commonMain/resources/MR/base/strings.xml b/sample-declarative-ui/shared/src/commonMain/moko-resources/base/strings.xml similarity index 100% rename from sample-declarative-ui/shared/src/commonMain/resources/MR/base/strings.xml rename to sample-declarative-ui/shared/src/commonMain/moko-resources/base/strings.xml diff --git a/sample/mpp-library/build.gradle.kts b/sample/mpp-library/build.gradle.kts index 8890cb3..9749539 100644 --- a/sample/mpp-library/build.gradle.kts +++ b/sample/mpp-library/build.gradle.kts @@ -1,3 +1,6 @@ +import io.gitlab.arturbosch.detekt.Detekt +import java.util.Locale + /* * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ @@ -25,10 +28,12 @@ dependencies { commonMainApi(libs.mokoMvvmLiveData) commonMainApi(libs.mokoMvvmLiveDataResources) commonMainApi(projects.fieldsLivedata) + + iosMainImplementation("dev.icerock.moko:parcelize:0.9.0") } multiplatformResources { - multiplatformResourcesPackage = "com.icerockdev.library" + resourcesPackage.set("com.icerockdev.library") } framework { diff --git a/sample/mpp-library/src/commonMain/resources/MR/base/strings.xml b/sample/mpp-library/src/commonMain/moko-resources/base/strings.xml similarity index 100% rename from sample/mpp-library/src/commonMain/resources/MR/base/strings.xml rename to sample/mpp-library/src/commonMain/moko-resources/base/strings.xml diff --git a/settings.gradle.kts b/settings.gradle.kts index c892581..1e0bd15 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,6 @@ /* * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ -enableFeaturePreview("VERSION_CATALOGS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") dependencyResolutionManagement { From e070b337222ae0eb1ed2ee2817d25e2c329e98bb Mon Sep 17 00:00:00 2001 From: Kolchurin Konstantin Date: Tue, 15 Apr 2025 23:44:32 +0700 Subject: [PATCH 10/12] #54 set jdk 17 for ci --- .github/workflows/compilation-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index 19367b3..62122c5 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Print Xcode version run: xcodebuild -version - name: Check build From a05af9959f678258f5915f53aba62e8235f9702d Mon Sep 17 00:00:00 2001 From: Sergey Panov Date: Tue, 24 Jun 2025 14:55:33 +0700 Subject: [PATCH 11/12] #54 fix ios sample --- sample/ios-app/Podfile.lock | 2 +- .../TestProj.xcodeproj/project.pbxproj | 20 +- ...icerock_moko_mvvm-livedata-resources.swift | 44 +++ .../dev_icerock_moko_mvvm-livedata.swift | 163 +++++++++ ...icerock_moko_mvvm-livedata-resources.swift | 44 +++ .../dev_icerock_moko_mvvm-livedata.swift | 163 +++++++++ .../kswift/dev_icerock_moko_resources.swift | 65 ++++ ...ains_kotlinx_kotlinx-coroutines-core.swift | 338 ++++++++++++++++++ .../MultiPlatformLibrarySwift.podspec | 15 + sample/mpp-library/build.gradle.kts | 19 + 10 files changed, 862 insertions(+), 11 deletions(-) create mode 100644 sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift create mode 100644 sample/ios-app/dev_icerock_moko_mvvm-livedata.swift create mode 100644 sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift create mode 100644 sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift create mode 100644 sample/ios-app/kswift/dev_icerock_moko_resources.swift create mode 100644 sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift create mode 100644 sample/mpp-library/MultiPlatformLibrarySwift.podspec diff --git a/sample/ios-app/Podfile.lock b/sample/ios-app/Podfile.lock index 4fbf6a6..0b09db7 100644 --- a/sample/ios-app/Podfile.lock +++ b/sample/ios-app/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 407e24455d8967c472bda10cdbc0fe637bc20d05 -COCOAPODS: 1.11.3 +COCOAPODS: 1.16.2 diff --git a/sample/ios-app/TestProj.xcodeproj/project.pbxproj b/sample/ios-app/TestProj.xcodeproj/project.pbxproj index 51dfc5c..88dcd8c 100644 --- a/sample/ios-app/TestProj.xcodeproj/project.pbxproj +++ b/sample/ios-app/TestProj.xcodeproj/project.pbxproj @@ -7,19 +7,17 @@ objects = { /* Begin PBXBuildFile section */ - 2223D08027D24BA000DB5F95 /* dev_icerock_moko_mvvm-livedata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2223D07F27D24BA000DB5F95 /* dev_icerock_moko_mvvm-livedata.swift */; }; - 2223D08227D24D7500DB5F95 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2223D08127D24D7500DB5F95 /* dev_icerock_moko_mvvm-livedata-resources.swift */; }; 2B70A10DE02726CA8E6981EB /* Pods_TestProj.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8D683A7C91DCD56058C7435 /* Pods_TestProj.framework */; }; 45D74FCC22BFDDFD00CAB0C8 /* TestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45D74FCB22BFDDFD00CAB0C8 /* TestViewController.swift */; }; 45F4791D219463C7003D25FA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45F47912219463C7003D25FA /* LaunchScreen.storyboard */; }; 45F4791E219463C7003D25FA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45F47914219463C7003D25FA /* Main.storyboard */; }; 45F47921219463C7003D25FA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45F4791A219463C7003D25FA /* Assets.xcassets */; }; 45F47922219463C7003D25FA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F4791B219463C7003D25FA /* AppDelegate.swift */; }; + DE7B200A2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */; }; + DE7B200B2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 2223D07F27D24BA000DB5F95 /* dev_icerock_moko_mvvm-livedata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "dev_icerock_moko_mvvm-livedata.swift"; path = "../mpp-library/build/cocoapods/framework/MultiPlatformLibrarySwift/dev_icerock_moko_mvvm-livedata.swift"; sourceTree = ""; }; - 2223D08127D24D7500DB5F95 /* dev_icerock_moko_mvvm-livedata-resources.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "dev_icerock_moko_mvvm-livedata-resources.swift"; path = "../mpp-library/build/cocoapods/framework/MultiPlatformLibrarySwift/dev_icerock_moko_mvvm-livedata-resources.swift"; sourceTree = ""; }; 287627FF1F319065007FA12B /* mokoSampleFields.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = mokoSampleFields.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45964D362282A1FD00C16658 /* mpp-library */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "mpp-library"; path = "../mpp-library"; sourceTree = ""; }; 45D74FCB22BFDDFD00CAB0C8 /* TestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestViewController.swift; sourceTree = ""; }; @@ -29,6 +27,8 @@ 45F4791B219463C7003D25FA /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45F4791C219463C7003D25FA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A644D2F1C5377C40A53FCD6A /* Pods-TestProj.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestProj/Pods-TestProj.release.xcconfig"; sourceTree = ""; }; + DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata.swift"; sourceTree = ""; }; + DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata-resources.swift"; sourceTree = ""; }; DFBDF7D3559D080FDCA444A6 /* Pods-TestProj.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestProj/Pods-TestProj.debug.xcconfig"; sourceTree = ""; }; E8D683A7C91DCD56058C7435 /* Pods_TestProj.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestProj.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -57,8 +57,8 @@ 2223D07E27D24B8900DB5F95 /* kswift */ = { isa = PBXGroup; children = ( - 2223D08127D24D7500DB5F95 /* dev_icerock_moko_mvvm-livedata-resources.swift */, - 2223D07F27D24BA000DB5F95 /* dev_icerock_moko_mvvm-livedata.swift */, + DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */, + DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */, ); name = kswift; sourceTree = ""; @@ -126,7 +126,7 @@ 287627FB1F319065007FA12B /* Sources */, 287627FC1F319065007FA12B /* Frameworks */, 287627FD1F319065007FA12B /* Resources */, - 1F30FEA104DFAFA202996FA6 /* [CP] Embed Pods Frameworks */, + A0E6ACB974C03BCECAC12349 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -187,7 +187,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1F30FEA104DFAFA202996FA6 /* [CP] Embed Pods Frameworks */ = { + A0E6ACB974C03BCECAC12349 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -231,10 +231,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2223D08227D24D7500DB5F95 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */, + DE7B200A2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */, + DE7B200B2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */, 45D74FCC22BFDDFD00CAB0C8 /* TestViewController.swift in Sources */, 45F47922219463C7003D25FA /* AppDelegate.swift in Sources */, - 2223D08027D24BA000DB5F95 /* dev_icerock_moko_mvvm-livedata.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift b/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift new file mode 100644 index 0000000..7b2590e --- /dev/null +++ b/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift @@ -0,0 +1,44 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import MultiPlatformLibrary +import UIKit + +public extension UIKit.UILabel { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UILabelBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextFieldBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextViewBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindTitle(liveData: LiveData) -> Closeable { + return UIButtonBindingKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} diff --git a/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift b/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift new file mode 100644 index 0000000..1dc7607 --- /dev/null +++ b/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift @@ -0,0 +1,163 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import Foundation +import MultiPlatformLibrary +import UIKit + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindBackgroundColor/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueColor:Class(name=platform/UIKit/UIColor),falseColor:Class(name=platform/UIKit/UIColor) + */ + @discardableResult + public func bindBackgroundColor( + liveData: LiveData, + trueColor: UIColor, + falseColor: UIColor + ) -> Closeable { + return UIViewBindingsKt.bindBackgroundColor(self, liveData: liveData, trueColor: trueColor, falseColor: falseColor) + } +} + +public extension UIKit.UIControl { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindEnabled/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindEnabled(liveData: LiveData) -> Closeable { + return UIControlBindingsKt.bindEnabled(self, liveData: liveData) + } +} + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindFocus/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindFocus(liveData: LiveData) -> Closeable { + return UIViewBindingsKt.bindFocus(self, liveData: liveData) + } +} + +public extension UIKit.UIControl { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { + return UIControlBindingsKt.bindFocusTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextViewBindingsKt.bindFocusTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindHidden/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindHidden(liveData: LiveData) -> Closeable { + return UIViewBindingsKt.bindHidden(self, liveData: liveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindImage/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueImage:Class(name=platform/UIKit/UIImage),falseImage:Class(name=platform/UIKit/UIImage) + */ + @discardableResult + public func bindImage( + liveData: LiveData, + trueImage: UIImage, + falseImage: UIImage + ) -> Closeable { + return UIButtonBindingsKt.bindImage(self, liveData: liveData, trueImage: trueImage, falseImage: falseImage) + } +} + +public extension UIKit.UISwitch { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOn/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindSwitchOn(liveData: LiveData) -> Closeable { + return UISwitchBindingsKt.bindSwitchOn(self, liveData: liveData) + } +} + +public extension UIKit.UISwitch { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOnTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindSwitchOnTwoWay(liveData: MutableLiveData) -> Closeable { + return UISwitchBindingsKt.bindSwitchOnTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UILabel { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UILabelBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextFieldBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextViewBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextFieldBindingsKt.bindTextTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextViewBindingsKt.bindTextTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindTitle(liveData: LiveData) -> Closeable { + return UIButtonBindingsKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} diff --git a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift new file mode 100644 index 0000000..7b2590e --- /dev/null +++ b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift @@ -0,0 +1,44 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import MultiPlatformLibrary +import UIKit + +public extension UIKit.UILabel { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UILabelBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextFieldBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextViewBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindTitle(liveData: LiveData) -> Closeable { + return UIButtonBindingKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} diff --git a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift new file mode 100644 index 0000000..1dc7607 --- /dev/null +++ b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift @@ -0,0 +1,163 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import Foundation +import MultiPlatformLibrary +import UIKit + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindBackgroundColor/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueColor:Class(name=platform/UIKit/UIColor),falseColor:Class(name=platform/UIKit/UIColor) + */ + @discardableResult + public func bindBackgroundColor( + liveData: LiveData, + trueColor: UIColor, + falseColor: UIColor + ) -> Closeable { + return UIViewBindingsKt.bindBackgroundColor(self, liveData: liveData, trueColor: trueColor, falseColor: falseColor) + } +} + +public extension UIKit.UIControl { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindEnabled/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindEnabled(liveData: LiveData) -> Closeable { + return UIControlBindingsKt.bindEnabled(self, liveData: liveData) + } +} + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindFocus/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindFocus(liveData: LiveData) -> Closeable { + return UIViewBindingsKt.bindFocus(self, liveData: liveData) + } +} + +public extension UIKit.UIControl { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { + return UIControlBindingsKt.bindFocusTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextViewBindingsKt.bindFocusTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UIView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindHidden/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindHidden(liveData: LiveData) -> Closeable { + return UIViewBindingsKt.bindHidden(self, liveData: liveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindImage/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueImage:Class(name=platform/UIKit/UIImage),falseImage:Class(name=platform/UIKit/UIImage) + */ + @discardableResult + public func bindImage( + liveData: LiveData, + trueImage: UIImage, + falseImage: UIImage + ) -> Closeable { + return UIButtonBindingsKt.bindImage(self, liveData: liveData, trueImage: trueImage, falseImage: falseImage) + } +} + +public extension UIKit.UISwitch { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOn/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindSwitchOn(liveData: LiveData) -> Closeable { + return UISwitchBindingsKt.bindSwitchOn(self, liveData: liveData) + } +} + +public extension UIKit.UISwitch { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOnTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindSwitchOnTwoWay(liveData: MutableLiveData) -> Closeable { + return UISwitchBindingsKt.bindSwitchOnTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UILabel { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UILabelBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextFieldBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindText(liveData: LiveData) -> Closeable { + return UITextViewBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} + +public extension UIKit.UITextField { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextFieldBindingsKt.bindTextTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UITextView { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) + */ + @discardableResult + public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { + return UITextViewBindingsKt.bindTextTwoWay(self, liveData: liveData) + } +} + +public extension UIKit.UIButton { + /** + * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) + */ + @discardableResult + public func bindTitle(liveData: LiveData) -> Closeable { + return UIButtonBindingsKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) + } +} diff --git a/sample/ios-app/kswift/dev_icerock_moko_resources.swift b/sample/ios-app/kswift/dev_icerock_moko_resources.swift new file mode 100644 index 0000000..dbaeb2a --- /dev/null +++ b/sample/ios-app/kswift/dev_icerock_moko_resources.swift @@ -0,0 +1,65 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import Foundation +import MultiPlatformLibrary +import UIKit + +public extension Foundation.Bundle { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.utils/Class(name=platform/Foundation/NSBundle.Companion)/loadableBundle/identifier:Class(name=kotlin/String) + */ + @discardableResult + public class func loadableBundle(identifier: String) -> Bundle { + return NSBundleExtKt.loadableBundle(self, identifier: identifier) + } +} + +public extension Swift.String { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc/Class(name=kotlin/String)/desc/ + */ + @discardableResult + public func desc() -> RawStringDesc { + return StringDescKt.desc(self) + } +} + +public extension MultiPlatformLibrary.StringDesc { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc/Class(name=dev/icerock/moko/resources/desc/StringDesc)/plus/other:Class(name=dev/icerock/moko/resources/desc/StringDesc) + */ + @discardableResult + public func plus(other: StringDesc) -> StringDesc { + return StringDescKt.plus(self, other: other) + } +} + +public extension MultiPlatformLibrary.Color { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.color/Class(name=dev/icerock/moko/graphics/Color)/asColorDesc/ + */ + @discardableResult + public func asColorDesc() -> ColorDesc { + return ColorDescSingleKt.asColorDesc(self) + } +} + +public extension MultiPlatformLibrary.ColorDesc { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.color/Class(name=dev/icerock/moko/resources/desc/color/ColorDesc)/getUIColor/ + */ + @discardableResult + public func getUIColor() -> UIColor { + return ColorDescExtKt.getUIColor(self) + } +} + +public extension Swift.String { + /** + * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.image/Class(name=kotlin/String)/asImageUrl/ + */ + @discardableResult + public func asImageUrl() -> ImageDesc { + return ImageDescUrlKt.asImageUrl(self) + } +} diff --git a/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift b/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift new file mode 100644 index 0000000..9ab2bc6 --- /dev/null +++ b/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift @@ -0,0 +1,338 @@ +// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) +// +import Foundation +import MultiPlatformLibrary + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/async/context:Class(name=kotlin/coroutines/CoroutineContext),start:Class(name=kotlinx/coroutines/CoroutineStart),block:Class(name=kotlin/Function2),Class(name=kotlin/Any)> + */ + @discardableResult + public func async( + context: CoroutineContext, + start: CoroutineStart, + block: Function2, AnyObject> + ) -> Deferred { + return Builders.commonKt.async(self, context: context, start: start, block: block) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/ + */ + @discardableResult + public func cancel() { + return JobKt.cancel(self) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/cause:Class(name=kotlin/Throwable) + */ + @discardableResult + public func cancel(cause: KotlinThrowable) -> Bool { + return JobKt.cancel(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) + */ + @discardableResult + public func cancel(cause: CancellationException) { + return JobKt.cancel(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/cancel/message:Class(name=kotlin/String),cause:Class(name=kotlin/Throwable) + */ + @discardableResult + public func cancel(message: String, cause: KotlinThrowable) { + return CoroutineScopeKt.cancel(self, message: message, cause: cause) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/cancel/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) + */ + @discardableResult + public func cancel(cause: CancellationException) { + return CoroutineScopeKt.cancel(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancel/message:Class(name=kotlin/String),cause:Class(name=kotlin/Throwable) + */ + @discardableResult + public func cancel(message: String, cause: KotlinThrowable) { + return JobKt.cancel(self, message: message, cause: cause) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelAndJoin/ + */ + @discardableResult + public func cancelAndJoin() { + return JobKt.cancelAndJoin(self) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/ + */ + @discardableResult + public func cancelChildren() { + return JobKt.cancelChildren(self) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/cause:Class(name=kotlin/Throwable) + */ + @discardableResult + public func cancelChildren(cause: KotlinThrowable) { + return JobKt.cancelChildren(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) + */ + @discardableResult + public func cancelChildren(cause: CancellationException) { + return JobKt.cancelChildren(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/ + */ + @discardableResult + public func cancelChildren() { + return JobKt.cancelChildren(self) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/cause:Class(name=kotlin/Throwable) + */ + @discardableResult + public func cancelChildren(cause: KotlinThrowable) { + return JobKt.cancelChildren(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) + */ + @discardableResult + public func cancelChildren(cause: CancellationException) { + return JobKt.cancelChildren(self, cause: cause) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/ensureActive/ + */ + @discardableResult + public func ensureActive() { + return JobKt.ensureActive(self) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/ensureActive/ + */ + @discardableResult + public func ensureActive() { + return CoroutineScopeKt.ensureActive(self) + } +} + +public extension MultiPlatformLibrary.Job { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/ensureActive/ + */ + @discardableResult + public func ensureActive() { + return JobKt.ensureActive(self) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/launch/context:Class(name=kotlin/coroutines/CoroutineContext),start:Class(name=kotlinx/coroutines/CoroutineStart),block:Class(name=kotlin/Function2),Class(name=kotlin/Any)> + */ + @discardableResult + public func launch( + context: CoroutineContext, + start: CoroutineStart, + block: Function2, AnyObject> + ) -> Job { + return Builders.commonKt.launch(self, context: context, start: start, block: block) + } +} + +public extension MultiPlatformLibrary.CoroutineContext { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/newCoroutineContext/addedContext:Class(name=kotlin/coroutines/CoroutineContext) + */ + @discardableResult + public func newCoroutineContext(addedContext: CoroutineContext) -> CoroutineContext { + return CoroutineContextKt.newCoroutineContext(self, addedContext: addedContext) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/newCoroutineContext/context:Class(name=kotlin/coroutines/CoroutineContext) + */ + @discardableResult + public func newCoroutineContext(context: CoroutineContext) -> CoroutineContext { + return CoroutineContextKt.newCoroutineContext(self, context: context) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/plus/context:Class(name=kotlin/coroutines/CoroutineContext) + */ + @discardableResult + public func plus(context: CoroutineContext) -> CoroutineScope { + return CoroutineScopeKt.plus(self, context: context) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/broadcast/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),start:Class(name=kotlinx/coroutines/CoroutineStart),onCompletion:Class(name=kotlin/Function1),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> + */ + @discardableResult + public func broadcast( + context: CoroutineContext, + capacity: NSNumber, + start: CoroutineStart, + onCompletion: @escaping (KotlinThrowable) -> Void, + block: Function2, Continuation, AnyObject> + ) -> BroadcastChannel { + return BroadcastKt.broadcast(self, context: context, capacity: capacity, start: start, onCompletion: onCompletion, block: block) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/produce/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),start:Class(name=kotlinx/coroutines/CoroutineStart),onCompletion:Class(name=kotlin/Function1),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> + */ + @discardableResult + public func produce( + context: CoroutineContext, + capacity: NSNumber, + start: CoroutineStart, + onCompletion: @escaping (KotlinThrowable) -> Void, + block: Function2, Continuation, AnyObject> + ) -> ReceiveChannel { + return ProduceKt.produce(self, context: context, capacity: capacity, start: start, onCompletion: onCompletion, block: block) + } +} + +public extension MultiPlatformLibrary.CoroutineScope { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/produce/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> + */ + @discardableResult + public func produce( + context: CoroutineContext, + capacity: NSNumber, + block: Function2, Continuation, AnyObject> + ) -> ReceiveChannel { + return ProduceKt.produce(self, context: context, capacity: capacity, block: block) + } +} + +public extension MultiPlatformLibrary.KotlinArray { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/Array)/asFlow/ + */ + @discardableResult + public func asFlow() -> Flow { + return BuildersKt.asFlow(self) + } +} + +public extension MultiPlatformLibrary.KotlinIntArray { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/IntArray)/asFlow/ + */ + @discardableResult + public func asFlow() -> Flow { + return BuildersKt.asFlow(self) + } +} + +public extension MultiPlatformLibrary.KotlinLongArray { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/LongArray)/asFlow/ + */ + @discardableResult + public func asFlow() -> Flow { + return BuildersKt.asFlow(self) + } +} + +public extension MultiPlatformLibrary.IntRange { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/ranges/IntRange)/asFlow/ + */ + @discardableResult + public func asFlow() -> Flow { + return BuildersKt.asFlow(self) + } +} + +public extension MultiPlatformLibrary.LongRange { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/ranges/LongRange)/asFlow/ + */ + @discardableResult + public func asFlow() -> Flow { + return BuildersKt.asFlow(self) + } +} + +public extension MultiPlatformLibrary.Mutex { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.sync/Class(name=kotlinx/coroutines/sync/Mutex)/withLock/owner:Class(name=kotlin/Any),action:Class(name=kotlin/Function0) + */ + @discardableResult + public func withLock(owner: AnyObject, action: Function0) -> T { + return MutexKt.withLock(self, owner: owner, action: action as! MultiPlatformLibrary.Function0) + } +} + +public extension MultiPlatformLibrary.Semaphore { + /** + * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.sync/Class(name=kotlinx/coroutines/sync/Semaphore)/withPermit/action:Class(name=kotlin/Function0) + */ + @discardableResult + public func withPermit(action: Function0) -> T { + return SemaphoreKt.withPermit(self, action: action as! MultiPlatformLibrary.Function0) + } +} diff --git a/sample/mpp-library/MultiPlatformLibrarySwift.podspec b/sample/mpp-library/MultiPlatformLibrarySwift.podspec new file mode 100644 index 0000000..96b68a6 --- /dev/null +++ b/sample/mpp-library/MultiPlatformLibrarySwift.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |spec| + spec.name = 'MultiPlatformLibrarySwift' + spec.version = '1.0' + spec.homepage = 'Link to a Kotlin/Native module homepage' + spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" } + spec.authors = '' + spec.license = '' + spec.summary = 'Some description for a Kotlin/Native module' + spec.module_name = "MultiPlatformLibrarySwift" + + + spec.static_framework = false + spec.dependency 'MultiPlatformLibrary' + spec.source_files = "build/cocoapods/framework/MultiPlatformLibrarySwift/**/*.{h,m,swift}" +end \ No newline at end of file diff --git a/sample/mpp-library/build.gradle.kts b/sample/mpp-library/build.gradle.kts index 9749539..d9973e4 100644 --- a/sample/mpp-library/build.gradle.kts +++ b/sample/mpp-library/build.gradle.kts @@ -1,4 +1,5 @@ import io.gitlab.arturbosch.detekt.Detekt +import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import java.util.Locale /* @@ -45,5 +46,23 @@ framework { } kswift { + projectPodspecName.set("MultiPlatformLibrary") + install(dev.icerock.moko.kswift.plugin.feature.PlatformExtensionFunctionsFeature) } + +kotlin.targets.withType().configureEach { + binaries.withType().configureEach { + embedBitcodeMode.set(org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode.DISABLE) + linkTask.doLast { + println("start copy kswift files") + val file = File(outputDirectory, "${baseName}Swift") + println(file.absolutePath) + val from = file.takeIf { it.exists() } ?: return@doLast + println("from $from") + val to = File(rootDir, "sample/ios-app/kswift") + println("to $to") + from.copyRecursively(to, overwrite = true) + } + } +} From 0ab3abbd2d9967da4317a3c3cdc9798ecf4b5347 Mon Sep 17 00:00:00 2001 From: Sergey Panov Date: Tue, 24 Jun 2025 15:17:55 +0700 Subject: [PATCH 12/12] #54 review fixes --- .../TestProj.xcodeproj/project.pbxproj | 32 +- ...icerock_moko_mvvm-livedata-resources.swift | 44 --- .../dev_icerock_moko_mvvm-livedata.swift | 163 --------- ...icerock_moko_mvvm-livedata-resources.swift | 30 -- .../dev_icerock_moko_mvvm-livedata.swift | 148 -------- .../kswift/dev_icerock_moko_resources.swift | 65 ---- ...ains_kotlinx_kotlinx-coroutines-core.swift | 338 ------------------ sample/mpp-library/build.gradle.kts | 11 +- 8 files changed, 22 insertions(+), 809 deletions(-) delete mode 100644 sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift delete mode 100644 sample/ios-app/dev_icerock_moko_mvvm-livedata.swift delete mode 100644 sample/ios-app/kswift/dev_icerock_moko_resources.swift delete mode 100644 sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift diff --git a/sample/ios-app/TestProj.xcodeproj/project.pbxproj b/sample/ios-app/TestProj.xcodeproj/project.pbxproj index 88dcd8c..363e729 100644 --- a/sample/ios-app/TestProj.xcodeproj/project.pbxproj +++ b/sample/ios-app/TestProj.xcodeproj/project.pbxproj @@ -13,8 +13,8 @@ 45F4791E219463C7003D25FA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45F47914219463C7003D25FA /* Main.storyboard */; }; 45F47921219463C7003D25FA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45F4791A219463C7003D25FA /* Assets.xcassets */; }; 45F47922219463C7003D25FA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F4791B219463C7003D25FA /* AppDelegate.swift */; }; - DE7B200A2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */; }; - DE7B200B2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */; }; + DE7B200F2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B200C2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata.swift */; }; + DE7B20102E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7B200D2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -27,8 +27,8 @@ 45F4791B219463C7003D25FA /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45F4791C219463C7003D25FA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A644D2F1C5377C40A53FCD6A /* Pods-TestProj.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestProj/Pods-TestProj.release.xcconfig"; sourceTree = ""; }; - DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata.swift"; sourceTree = ""; }; - DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata-resources.swift"; sourceTree = ""; }; + DE7B200C2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata.swift"; sourceTree = ""; }; + DE7B200D2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dev_icerock_moko_mvvm-livedata-resources.swift"; sourceTree = ""; }; DFBDF7D3559D080FDCA444A6 /* Pods-TestProj.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestProj/Pods-TestProj.debug.xcconfig"; sourceTree = ""; }; E8D683A7C91DCD56058C7435 /* Pods_TestProj.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestProj.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -54,20 +54,11 @@ name = Pods; sourceTree = ""; }; - 2223D07E27D24B8900DB5F95 /* kswift */ = { - isa = PBXGroup; - children = ( - DE7B20082E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift */, - DE7B20092E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */, - ); - name = kswift; - sourceTree = ""; - }; 287627F61F319065007FA12B = { isa = PBXGroup; children = ( + DE7B200E2E0A96A400A41F56 /* kswift */, 45964D362282A1FD00C16658 /* mpp-library */, - 2223D07E27D24B8900DB5F95 /* kswift */, 45F47910219463C7003D25FA /* src */, 287628001F319065007FA12B /* Products */, EE1ABB3E79CE541540D3155F /* Frameworks */, @@ -107,6 +98,15 @@ path = Resources; sourceTree = ""; }; + DE7B200E2E0A96A400A41F56 /* kswift */ = { + isa = PBXGroup; + children = ( + DE7B200C2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata.swift */, + DE7B200D2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift */, + ); + path = kswift; + sourceTree = ""; + }; EE1ABB3E79CE541540D3155F /* Frameworks */ = { isa = PBXGroup; children = ( @@ -231,9 +231,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DE7B200A2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */, - DE7B200B2E0A913500A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */, 45D74FCC22BFDDFD00CAB0C8 /* TestViewController.swift in Sources */, + DE7B200F2E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata.swift in Sources */, + DE7B20102E0A96A400A41F56 /* dev_icerock_moko_mvvm-livedata-resources.swift in Sources */, 45F47922219463C7003D25FA /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift b/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift deleted file mode 100644 index 7b2590e..0000000 --- a/sample/ios-app/dev_icerock_moko_mvvm-livedata-resources.swift +++ /dev/null @@ -1,44 +0,0 @@ -// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) -// -import MultiPlatformLibrary -import UIKit - -public extension UIKit.UILabel { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UILabelBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextField { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextFieldBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextViewBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindTitle(liveData: LiveData) -> Closeable { - return UIButtonBindingKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} diff --git a/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift b/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift deleted file mode 100644 index 1dc7607..0000000 --- a/sample/ios-app/dev_icerock_moko_mvvm-livedata.swift +++ /dev/null @@ -1,163 +0,0 @@ -// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) -// -import Foundation -import MultiPlatformLibrary -import UIKit - -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindBackgroundColor/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueColor:Class(name=platform/UIKit/UIColor),falseColor:Class(name=platform/UIKit/UIColor) - */ - @discardableResult - public func bindBackgroundColor( - liveData: LiveData, - trueColor: UIColor, - falseColor: UIColor - ) -> Closeable { - return UIViewBindingsKt.bindBackgroundColor(self, liveData: liveData, trueColor: trueColor, falseColor: falseColor) - } -} - -public extension UIKit.UIControl { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindEnabled/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindEnabled(liveData: LiveData) -> Closeable { - return UIControlBindingsKt.bindEnabled(self, liveData: liveData) - } -} - -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindFocus/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindFocus(liveData: LiveData) -> Closeable { - return UIViewBindingsKt.bindFocus(self, liveData: liveData) - } -} - -public extension UIKit.UIControl { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { - return UIControlBindingsKt.bindFocusTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { - return UITextViewBindingsKt.bindFocusTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindHidden/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindHidden(liveData: LiveData) -> Closeable { - return UIViewBindingsKt.bindHidden(self, liveData: liveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindImage/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueImage:Class(name=platform/UIKit/UIImage),falseImage:Class(name=platform/UIKit/UIImage) - */ - @discardableResult - public func bindImage( - liveData: LiveData, - trueImage: UIImage, - falseImage: UIImage - ) -> Closeable { - return UIButtonBindingsKt.bindImage(self, liveData: liveData, trueImage: trueImage, falseImage: falseImage) - } -} - -public extension UIKit.UISwitch { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOn/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindSwitchOn(liveData: LiveData) -> Closeable { - return UISwitchBindingsKt.bindSwitchOn(self, liveData: liveData) - } -} - -public extension UIKit.UISwitch { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOnTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindSwitchOnTwoWay(liveData: MutableLiveData) -> Closeable { - return UISwitchBindingsKt.bindSwitchOnTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UILabel { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UILabelBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextField { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextFieldBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextViewBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextField { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { - return UITextFieldBindingsKt.bindTextTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { - return UITextViewBindingsKt.bindTextTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindTitle(liveData: LiveData) -> Closeable { - return UIButtonBindingsKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} diff --git a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift index 7b2590e..3032c16 100644 --- a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift +++ b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata-resources.swift @@ -12,33 +12,3 @@ public extension UIKit.UILabel { return UILabelBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) } } - -public extension UIKit.UITextField { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextFieldBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextViewBindingKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindTitle(liveData: LiveData) -> Closeable { - return UIButtonBindingKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} diff --git a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift index 1dc7607..ea309c2 100644 --- a/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift +++ b/sample/ios-app/kswift/dev_icerock_moko_mvvm-livedata.swift @@ -4,134 +4,6 @@ import Foundation import MultiPlatformLibrary import UIKit -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindBackgroundColor/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueColor:Class(name=platform/UIKit/UIColor),falseColor:Class(name=platform/UIKit/UIColor) - */ - @discardableResult - public func bindBackgroundColor( - liveData: LiveData, - trueColor: UIColor, - falseColor: UIColor - ) -> Closeable { - return UIViewBindingsKt.bindBackgroundColor(self, liveData: liveData, trueColor: trueColor, falseColor: falseColor) - } -} - -public extension UIKit.UIControl { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindEnabled/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindEnabled(liveData: LiveData) -> Closeable { - return UIControlBindingsKt.bindEnabled(self, liveData: liveData) - } -} - -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindFocus/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindFocus(liveData: LiveData) -> Closeable { - return UIViewBindingsKt.bindFocus(self, liveData: liveData) - } -} - -public extension UIKit.UIControl { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIControl)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { - return UIControlBindingsKt.bindFocusTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindFocusTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindFocusTwoWay(liveData: MutableLiveData) -> Closeable { - return UITextViewBindingsKt.bindFocusTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UIView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIView)/bindHidden/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindHidden(liveData: LiveData) -> Closeable { - return UIViewBindingsKt.bindHidden(self, liveData: liveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindImage/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData),trueImage:Class(name=platform/UIKit/UIImage),falseImage:Class(name=platform/UIKit/UIImage) - */ - @discardableResult - public func bindImage( - liveData: LiveData, - trueImage: UIImage, - falseImage: UIImage - ) -> Closeable { - return UIButtonBindingsKt.bindImage(self, liveData: liveData, trueImage: trueImage, falseImage: falseImage) - } -} - -public extension UIKit.UISwitch { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOn/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindSwitchOn(liveData: LiveData) -> Closeable { - return UISwitchBindingsKt.bindSwitchOn(self, liveData: liveData) - } -} - -public extension UIKit.UISwitch { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UISwitch)/bindSwitchOnTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindSwitchOnTwoWay(liveData: MutableLiveData) -> Closeable { - return UISwitchBindingsKt.bindSwitchOnTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UILabel { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UILabelBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextField { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextFieldBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindText(liveData: LiveData) -> Closeable { - return UITextViewBindingsKt.bindText(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} - public extension UIKit.UITextField { /** * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) @@ -141,23 +13,3 @@ public extension UIKit.UITextField { return UITextFieldBindingsKt.bindTextTwoWay(self, liveData: liveData) } } - -public extension UIKit.UITextView { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextView)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData) - */ - @discardableResult - public func bindTextTwoWay(liveData: MutableLiveData) -> Closeable { - return UITextViewBindingsKt.bindTextTwoWay(self, liveData: liveData) - } -} - -public extension UIKit.UIButton { - /** - * selector: PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UIButton)/bindTitle/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData) - */ - @discardableResult - public func bindTitle(liveData: LiveData) -> Closeable { - return UIButtonBindingsKt.bindTitle(self, liveData: liveData as! MultiPlatformLibrary.LiveData) - } -} diff --git a/sample/ios-app/kswift/dev_icerock_moko_resources.swift b/sample/ios-app/kswift/dev_icerock_moko_resources.swift deleted file mode 100644 index dbaeb2a..0000000 --- a/sample/ios-app/kswift/dev_icerock_moko_resources.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) -// -import Foundation -import MultiPlatformLibrary -import UIKit - -public extension Foundation.Bundle { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.utils/Class(name=platform/Foundation/NSBundle.Companion)/loadableBundle/identifier:Class(name=kotlin/String) - */ - @discardableResult - public class func loadableBundle(identifier: String) -> Bundle { - return NSBundleExtKt.loadableBundle(self, identifier: identifier) - } -} - -public extension Swift.String { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc/Class(name=kotlin/String)/desc/ - */ - @discardableResult - public func desc() -> RawStringDesc { - return StringDescKt.desc(self) - } -} - -public extension MultiPlatformLibrary.StringDesc { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc/Class(name=dev/icerock/moko/resources/desc/StringDesc)/plus/other:Class(name=dev/icerock/moko/resources/desc/StringDesc) - */ - @discardableResult - public func plus(other: StringDesc) -> StringDesc { - return StringDescKt.plus(self, other: other) - } -} - -public extension MultiPlatformLibrary.Color { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.color/Class(name=dev/icerock/moko/graphics/Color)/asColorDesc/ - */ - @discardableResult - public func asColorDesc() -> ColorDesc { - return ColorDescSingleKt.asColorDesc(self) - } -} - -public extension MultiPlatformLibrary.ColorDesc { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.color/Class(name=dev/icerock/moko/resources/desc/color/ColorDesc)/getUIColor/ - */ - @discardableResult - public func getUIColor() -> UIColor { - return ColorDescExtKt.getUIColor(self) - } -} - -public extension Swift.String { - /** - * selector: PackageFunctionContext/dev.icerock.moko:resources/dev.icerock.moko.resources.desc.image/Class(name=kotlin/String)/asImageUrl/ - */ - @discardableResult - public func asImageUrl() -> ImageDesc { - return ImageDescUrlKt.asImageUrl(self) - } -} diff --git a/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift b/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift deleted file mode 100644 index 9ab2bc6..0000000 --- a/sample/ios-app/kswift/org_jetbrains_kotlinx_kotlinx-coroutines-core.swift +++ /dev/null @@ -1,338 +0,0 @@ -// This file automatically generated by MOKO KSwift (https://github.com/icerockdev/moko-kswift) -// -import Foundation -import MultiPlatformLibrary - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/async/context:Class(name=kotlin/coroutines/CoroutineContext),start:Class(name=kotlinx/coroutines/CoroutineStart),block:Class(name=kotlin/Function2),Class(name=kotlin/Any)> - */ - @discardableResult - public func async( - context: CoroutineContext, - start: CoroutineStart, - block: Function2, AnyObject> - ) -> Deferred { - return Builders.commonKt.async(self, context: context, start: start, block: block) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/ - */ - @discardableResult - public func cancel() { - return JobKt.cancel(self) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/cause:Class(name=kotlin/Throwable) - */ - @discardableResult - public func cancel(cause: KotlinThrowable) -> Bool { - return JobKt.cancel(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancel/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) - */ - @discardableResult - public func cancel(cause: CancellationException) { - return JobKt.cancel(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/cancel/message:Class(name=kotlin/String),cause:Class(name=kotlin/Throwable) - */ - @discardableResult - public func cancel(message: String, cause: KotlinThrowable) { - return CoroutineScopeKt.cancel(self, message: message, cause: cause) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/cancel/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) - */ - @discardableResult - public func cancel(cause: CancellationException) { - return CoroutineScopeKt.cancel(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancel/message:Class(name=kotlin/String),cause:Class(name=kotlin/Throwable) - */ - @discardableResult - public func cancel(message: String, cause: KotlinThrowable) { - return JobKt.cancel(self, message: message, cause: cause) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelAndJoin/ - */ - @discardableResult - public func cancelAndJoin() { - return JobKt.cancelAndJoin(self) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/ - */ - @discardableResult - public func cancelChildren() { - return JobKt.cancelChildren(self) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/cause:Class(name=kotlin/Throwable) - */ - @discardableResult - public func cancelChildren(cause: KotlinThrowable) { - return JobKt.cancelChildren(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/cancelChildren/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) - */ - @discardableResult - public func cancelChildren(cause: CancellationException) { - return JobKt.cancelChildren(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/ - */ - @discardableResult - public func cancelChildren() { - return JobKt.cancelChildren(self) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/cause:Class(name=kotlin/Throwable) - */ - @discardableResult - public func cancelChildren(cause: KotlinThrowable) { - return JobKt.cancelChildren(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/cancelChildren/cause:Class(name=kotlin/coroutines/cancellation/CancellationException) - */ - @discardableResult - public func cancelChildren(cause: CancellationException) { - return JobKt.cancelChildren(self, cause: cause) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/ensureActive/ - */ - @discardableResult - public func ensureActive() { - return JobKt.ensureActive(self) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/ensureActive/ - */ - @discardableResult - public func ensureActive() { - return CoroutineScopeKt.ensureActive(self) - } -} - -public extension MultiPlatformLibrary.Job { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/Job)/ensureActive/ - */ - @discardableResult - public func ensureActive() { - return JobKt.ensureActive(self) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/launch/context:Class(name=kotlin/coroutines/CoroutineContext),start:Class(name=kotlinx/coroutines/CoroutineStart),block:Class(name=kotlin/Function2),Class(name=kotlin/Any)> - */ - @discardableResult - public func launch( - context: CoroutineContext, - start: CoroutineStart, - block: Function2, AnyObject> - ) -> Job { - return Builders.commonKt.launch(self, context: context, start: start, block: block) - } -} - -public extension MultiPlatformLibrary.CoroutineContext { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlin/coroutines/CoroutineContext)/newCoroutineContext/addedContext:Class(name=kotlin/coroutines/CoroutineContext) - */ - @discardableResult - public func newCoroutineContext(addedContext: CoroutineContext) -> CoroutineContext { - return CoroutineContextKt.newCoroutineContext(self, addedContext: addedContext) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/newCoroutineContext/context:Class(name=kotlin/coroutines/CoroutineContext) - */ - @discardableResult - public func newCoroutineContext(context: CoroutineContext) -> CoroutineContext { - return CoroutineContextKt.newCoroutineContext(self, context: context) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines/Class(name=kotlinx/coroutines/CoroutineScope)/plus/context:Class(name=kotlin/coroutines/CoroutineContext) - */ - @discardableResult - public func plus(context: CoroutineContext) -> CoroutineScope { - return CoroutineScopeKt.plus(self, context: context) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/broadcast/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),start:Class(name=kotlinx/coroutines/CoroutineStart),onCompletion:Class(name=kotlin/Function1),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> - */ - @discardableResult - public func broadcast( - context: CoroutineContext, - capacity: NSNumber, - start: CoroutineStart, - onCompletion: @escaping (KotlinThrowable) -> Void, - block: Function2, Continuation, AnyObject> - ) -> BroadcastChannel { - return BroadcastKt.broadcast(self, context: context, capacity: capacity, start: start, onCompletion: onCompletion, block: block) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/produce/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),start:Class(name=kotlinx/coroutines/CoroutineStart),onCompletion:Class(name=kotlin/Function1),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> - */ - @discardableResult - public func produce( - context: CoroutineContext, - capacity: NSNumber, - start: CoroutineStart, - onCompletion: @escaping (KotlinThrowable) -> Void, - block: Function2, Continuation, AnyObject> - ) -> ReceiveChannel { - return ProduceKt.produce(self, context: context, capacity: capacity, start: start, onCompletion: onCompletion, block: block) - } -} - -public extension MultiPlatformLibrary.CoroutineScope { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.channels/Class(name=kotlinx/coroutines/CoroutineScope)/produce/context:Class(name=kotlin/coroutines/CoroutineContext),capacity:Class(name=kotlin/Int),block:Class(name=kotlin/Function2),Class(name=kotlin/coroutines/Continuation),Class(name=kotlin/Any)> - */ - @discardableResult - public func produce( - context: CoroutineContext, - capacity: NSNumber, - block: Function2, Continuation, AnyObject> - ) -> ReceiveChannel { - return ProduceKt.produce(self, context: context, capacity: capacity, block: block) - } -} - -public extension MultiPlatformLibrary.KotlinArray { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/Array)/asFlow/ - */ - @discardableResult - public func asFlow() -> Flow { - return BuildersKt.asFlow(self) - } -} - -public extension MultiPlatformLibrary.KotlinIntArray { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/IntArray)/asFlow/ - */ - @discardableResult - public func asFlow() -> Flow { - return BuildersKt.asFlow(self) - } -} - -public extension MultiPlatformLibrary.KotlinLongArray { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/LongArray)/asFlow/ - */ - @discardableResult - public func asFlow() -> Flow { - return BuildersKt.asFlow(self) - } -} - -public extension MultiPlatformLibrary.IntRange { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/ranges/IntRange)/asFlow/ - */ - @discardableResult - public func asFlow() -> Flow { - return BuildersKt.asFlow(self) - } -} - -public extension MultiPlatformLibrary.LongRange { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.flow/Class(name=kotlin/ranges/LongRange)/asFlow/ - */ - @discardableResult - public func asFlow() -> Flow { - return BuildersKt.asFlow(self) - } -} - -public extension MultiPlatformLibrary.Mutex { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.sync/Class(name=kotlinx/coroutines/sync/Mutex)/withLock/owner:Class(name=kotlin/Any),action:Class(name=kotlin/Function0) - */ - @discardableResult - public func withLock(owner: AnyObject, action: Function0) -> T { - return MutexKt.withLock(self, owner: owner, action: action as! MultiPlatformLibrary.Function0) - } -} - -public extension MultiPlatformLibrary.Semaphore { - /** - * selector: PackageFunctionContext/org.jetbrains.kotlinx:kotlinx-coroutines-core/kotlinx.coroutines.sync/Class(name=kotlinx/coroutines/sync/Semaphore)/withPermit/action:Class(name=kotlin/Function0) - */ - @discardableResult - public func withPermit(action: Function0) -> T { - return SemaphoreKt.withPermit(self, action: action as! MultiPlatformLibrary.Function0) - } -} diff --git a/sample/mpp-library/build.gradle.kts b/sample/mpp-library/build.gradle.kts index d9973e4..9b55b8c 100644 --- a/sample/mpp-library/build.gradle.kts +++ b/sample/mpp-library/build.gradle.kts @@ -48,20 +48,21 @@ framework { kswift { projectPodspecName.set("MultiPlatformLibrary") - install(dev.icerock.moko.kswift.plugin.feature.PlatformExtensionFunctionsFeature) + install(dev.icerock.moko.kswift.plugin.feature.PlatformExtensionFunctionsFeature) { + filter = includeFilter( + "PackageFunctionContext/dev.icerock.moko:mvvm-livedata/dev.icerock.moko.mvvm.livedata/Class(name=platform/UIKit/UITextField)/bindTextTwoWay/liveData:Class(name=dev/icerock/moko/mvvm/livedata/MutableLiveData)", + "PackageFunctionContext/dev.icerock.moko:mvvm-livedata-resources/dev.icerock.moko.mvvm.livedata.resources/Class(name=platform/UIKit/UILabel)/bindText/liveData:Class(name=dev/icerock/moko/mvvm/livedata/LiveData)" + ) + } } kotlin.targets.withType().configureEach { binaries.withType().configureEach { embedBitcodeMode.set(org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode.DISABLE) linkTask.doLast { - println("start copy kswift files") val file = File(outputDirectory, "${baseName}Swift") - println(file.absolutePath) val from = file.takeIf { it.exists() } ?: return@doLast - println("from $from") val to = File(rootDir, "sample/ios-app/kswift") - println("to $to") from.copyRecursively(to, overwrite = true) } }