diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe7cb18a46..e034c581b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' fetch-depth: 0 @@ -84,18 +84,18 @@ jobs: gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/app/src/release/agconnect-services.json - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' - name: Assemble - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2.9.0 with: arguments: assemble - name: Upload Android Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 if: github.event_name == 'push' with: name: androidArtifacts @@ -120,15 +120,15 @@ jobs: steps: - name: Clone Repo # Needed for reading commit message for Firebase App Distribution - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 - name: Download Android Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: androidArtifacts - name: Firebase App Distribution Google - uses: wzieba/Firebase-Distribution-Github-Action@v1.5.1 + uses: wzieba/Firebase-Distribution-Github-Action@v1.6.0 with: appId: ${{secrets.ANDROID_GOOGLE_FIREBASE_APP_ID}} token: ${{secrets.FIREBASE_CLI_TOKEN}} @@ -136,7 +136,7 @@ jobs: file: google/release/app-google-release.apk - name: Firebase App Distribution Huawei - uses: wzieba/Firebase-Distribution-Github-Action@v1.5.1 + uses: wzieba/Firebase-Distribution-Github-Action@v1.6.0 with: appId: ${{secrets.ANDROID_HUAWEI_FIREBASE_APP_ID}} token: ${{secrets.FIREBASE_CLI_TOKEN}} @@ -159,7 +159,7 @@ jobs: steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' fetch-depth: 0 @@ -184,25 +184,17 @@ jobs: gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch Release.xcconfig.asc > ios/CCC/Resources/Release/Config.xcconfig - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' - - name: Generate Pods - uses: gradle/gradle-build-action@v2.8.0 - with: - arguments: :ios:provider:podGenIOS :client:core:res:podGenIOS --parallel - - name: Build - run: | - cd ios/CCC - pod install --repo-update - cd .. - fastlane build + working-directory: ios + run: fastlane build - name: Upload iOS Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 if: github.event_name == 'push' with: name: iOSArtifacts @@ -226,18 +218,17 @@ jobs: status: ${{ steps.status.outputs.status }} steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 - name: Download iOS IPA - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: iOSArtifacts path: ios - name: Distribute - run: | - cd ios - fastlane distribute + working-directory: ios + run: fastlane distribute - name: Delete iOS IPA uses: geekyeggo/delete-artifact@v2.0.0 @@ -255,23 +246,23 @@ jobs: steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' - name: Run Quality Jobs - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2.9.0 with: arguments: check koverMergedXmlReport --parallel - name: Upload Coverage Report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: coverageReport path: build/reports/kover/merged/xml/report.xml @@ -291,10 +282,10 @@ jobs: status: ${{ steps.status.outputs.status }} steps: - name: Clone Repo # Codecov requires it - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 - name: Download Coverage Report - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: coverageReport path: build @@ -312,7 +303,7 @@ jobs: coverage-reports: build/report.xml - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@v2.0.1 + uses: sonarsource/sonarcloud-github-action@v2.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} @@ -338,18 +329,18 @@ jobs: steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' - name: Detekt - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2.9.0 with: arguments: detektAll diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index e3b715655e..20ef128cad 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -18,7 +18,7 @@ jobs: steps: - name: 'Add issue to project' if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened') - uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + uses: leonsteinhaeuser/project-beta-automations@v2.2.1 with: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} organization: Oztechan @@ -29,7 +29,7 @@ jobs: - name: 'Move Related Issue to "🏗 PR Review"' if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'ready_for_review' || github.event.action == 'reopened') - uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + uses: leonsteinhaeuser/project-beta-automations@v2.2.1 with: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} organization: Oztechan @@ -40,7 +40,7 @@ jobs: - name: 'Add Dependency PR by renovate to "🏗 PR Review"' if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' && (github.event.action == 'opened' || github.event.action == 'ready_for_review' || github.event.action == 'reopened') - uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + uses: leonsteinhaeuser/project-beta-automations@v2.2.1 with: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} organization: Oztechan @@ -51,7 +51,7 @@ jobs: - name: 'Move Related Issue to "🚧 In Progress"' if: github.event_name == 'pull_request' && github.event.action == 'converted_to_draft' - uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + uses: leonsteinhaeuser/project-beta-automations@v2.2.1 with: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} organization: Oztechan @@ -62,7 +62,7 @@ jobs: - name: 'Move Related Issue to "✅ Done"' if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true - uses: leonsteinhaeuser/project-beta-automations@v2.1.0 + uses: leonsteinhaeuser/project-beta-automations@v2.2.1 with: gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} organization: Oztechan diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 682e6818f3..d09714397e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,7 @@ jobs: uses: marvinpinto/action-automatic-releases@v1.2.1 with: repo_token: ${{ secrets.GITHUB_TOKEN }} + prerelease: false - name: Set Job Status id: status diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3d5e830fd..fa64aa5245 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' fetch-depth: 0 @@ -79,30 +79,30 @@ jobs: gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch agconnect-services.json.asc > android/app/src/release/agconnect-services.json - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' - name: Generate Artifacts - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2.9.0 with: arguments: :android:app:bundleRelease :backend:app:jar --parallel - name: Upload Google App Bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: googleBundle path: android/app/build/outputs/bundle/googleRelease/app-google-release.aab - name: Upload Huawei App Bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: huaweiBundle path: android/app/build/outputs/bundle/huaweiRelease/app-huawei-release.aab - name: Upload Backend Jar - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: backendJar path: backend/app/build/libs/app-*.jar @@ -119,7 +119,7 @@ jobs: steps: - name: Download App Bundle - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: googleBundle @@ -129,7 +129,7 @@ jobs: gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch service_account.json.asc > service_account.json - name: Upload Artifact to Google Play Console - uses: r0adkll/upload-google-play@v1.1.1 + uses: r0adkll/upload-google-play@v1.1.2 with: serviceAccountJson: service_account.json packageName: mustafaozhan.github.com.mycurrencies @@ -154,7 +154,7 @@ jobs: steps: - name: Download App Bundle - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: huaweiBundle @@ -185,13 +185,13 @@ jobs: steps: - name: Download Backend Jar - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3.0.2 with: name: backendJar path: artifact - name: Deploy to Server - uses: easingthemes/ssh-deploy@v4.1.8 + uses: easingthemes/ssh-deploy@v4.1.9 env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} REMOTE_HOST: ${{ secrets.REMOTE_HOST }} @@ -214,13 +214,13 @@ jobs: status: ${{ steps.status.outputs.status }} steps: - name: Clone Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.0 with: submodules: 'recursive' fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: java-version: 17 distribution: 'temurin' @@ -234,17 +234,9 @@ jobs: echo "${{ secrets.IOS_GPG_RELEASE_XCCONFIG }}" > Release.xcconfig.asc gpg -d --passphrase "${{ secrets.SECRET_PASSWORD }}" --batch Release.xcconfig.asc > ios/CCC/Resources/Release/Config.xcconfig - - name: Generate Pods - uses: gradle/gradle-build-action@v2.8.0 - with: - arguments: :ios:provider:podGenIOS :client:core:res:podGenIOS --parallel - - name: StoreBuild - run: | - cd ios/CCC - pod install --repo-update - cd .. - fastlane store_build + working-directory: ios + run: fastlane store_build - name: Set Job Status id: status diff --git a/.gitignore b/.gitignore index ab1ad6b1b9..bd74f2ef71 100644 --- a/.gitignore +++ b/.gitignore @@ -21,12 +21,7 @@ secret.properties # submodules /submodule -# Pods files -client/core/res/res.podspec -ios/provider/provider.podspec - # iOS Project -ios/Pods/ ios/CCC/Resources/Release/ ios/CCC/Resources/GoogleService-Info.plist ios/CCC/Resources/Config.xcconfig diff --git a/README.md b/README.md index 307d4a2f0f..4d9c443e57 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,7 @@ Open CCC folder with Android Studio and select `android:app` from configurations ### iOS -```shell -./gradlew :ios:provider:podspec :client:core:res:podspec --parallel && -cd ios/CCC && -pod install --repo-update -``` - -Then open `CCC/ios/CCC.xcworkspace` with XCode after the packages are resolved you can run the project, please not XCode version should be bigger than `13.2.1` +Open `CCC/ios/CCC.xcworkspace` with XCode after the packages are resolved you can run the project. Generally you should use the latest stable XCode version. ### Backend diff --git a/android/viewmodel/widget/src/main/kotlin/com/oztechan/ccc/android/viewmodel/widget/WidgetSEED.kt b/android/viewmodel/widget/src/main/kotlin/com/oztechan/ccc/android/viewmodel/widget/WidgetSEED.kt index 8e70af5f62..37c6517ce9 100644 --- a/android/viewmodel/widget/src/main/kotlin/com/oztechan/ccc/android/viewmodel/widget/WidgetSEED.kt +++ b/android/viewmodel/widget/src/main/kotlin/com/oztechan/ccc/android/viewmodel/widget/WidgetSEED.kt @@ -12,7 +12,7 @@ data class WidgetState( var lastUpdate: String = "", var currentBase: String, var isPremium: Boolean -) : BaseState() +) : BaseState // Event interface WidgetEvent : BaseEvent { @@ -23,12 +23,12 @@ interface WidgetEvent : BaseEvent { } // Effect -sealed class WidgetEffect : BaseEffect() { +sealed class WidgetEffect : BaseEffect { data object OpenApp : WidgetEffect() } // Data -class WidgetData : BaseData() { +class WidgetData : BaseData { companion object { internal const val MAXIMUM_NUMBER_OF_CURRENCY = 7 } diff --git a/client/core/res/client-core-res.gradle.kts b/client/core/res/client-core-res.gradle.kts index cb98ae046f..344848153b 100644 --- a/client/core/res/client-core-res.gradle.kts +++ b/client/core/res/client-core-res.gradle.kts @@ -3,7 +3,6 @@ import io.gitlab.arturbosch.detekt.Detekt plugins { libs.plugins.apply { id(multiplatform.get().pluginId) - id(cocoapods.get().pluginId) id(androidLib.get().pluginId) id(mokoResources.get().pluginId) } @@ -15,18 +14,12 @@ kotlin { androidTarget() - iosX64() - iosArm64() - iosSimulatorArm64() - - cocoapods { - ProjectSettings.apply { - summary = PROJECT_NAME - homepage = HOMEPAGE - ios.deploymentTarget = IOS_DEPLOYMENT_TARGET - version = getVersionName(project) - } - framework { + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { + it.binaries.framework { baseName = Modules.Client.Core.res.frameworkName isStatic = true } diff --git a/client/core/viewmodel/src/commonMain/kotlin/com/oztechan/ccc/client/core/viewmodel/BaseSEED.kt b/client/core/viewmodel/src/commonMain/kotlin/com/oztechan/ccc/client/core/viewmodel/BaseSEED.kt index c7b49eb705..a49e1e1489 100644 --- a/client/core/viewmodel/src/commonMain/kotlin/com/oztechan/ccc/client/core/viewmodel/BaseSEED.kt +++ b/client/core/viewmodel/src/commonMain/kotlin/com/oztechan/ccc/client/core/viewmodel/BaseSEED.kt @@ -4,10 +4,10 @@ package com.oztechan.ccc.client.core.viewmodel -open class BaseState +interface BaseState interface BaseEvent -open class BaseEffect +interface BaseEffect -open class BaseData +interface BaseData diff --git a/client/viewmodel/calculator/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/calculator/CalculatorSEED.kt b/client/viewmodel/calculator/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/calculator/CalculatorSEED.kt index 9e8d45ab91..172bb59b64 100644 --- a/client/viewmodel/calculator/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/calculator/CalculatorSEED.kt +++ b/client/viewmodel/calculator/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/calculator/CalculatorSEED.kt @@ -19,7 +19,7 @@ data class CalculatorState( val symbol: String = "", val loading: Boolean = true, val conversionState: ConversionState = ConversionState.None, -) : BaseState() +) : BaseState // Event interface CalculatorEvent : BaseEvent { @@ -36,7 +36,7 @@ interface CalculatorEvent : BaseEvent { } // Effect -sealed class CalculatorEffect : BaseEffect() { +sealed class CalculatorEffect : BaseEffect { data object Error : CalculatorEffect() data object FewCurrency : CalculatorEffect() data object OpenBar : CalculatorEffect() @@ -52,7 +52,7 @@ sealed class CalculatorEffect : BaseEffect() { data class CalculatorData( var parser: ParserMob = ParserMob(), var conversion: Conversion? = null -) : BaseData() { +) : BaseData { companion object { internal const val MAXIMUM_OUTPUT = 18 internal const val MAXIMUM_INPUT = 44 diff --git a/client/viewmodel/currencies/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/currencies/CurrenciesSEED.kt b/client/viewmodel/currencies/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/currencies/CurrenciesSEED.kt index bfba2bf73d..e6f2d24700 100644 --- a/client/viewmodel/currencies/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/currencies/CurrenciesSEED.kt +++ b/client/viewmodel/currencies/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/currencies/CurrenciesSEED.kt @@ -13,7 +13,7 @@ data class CurrenciesState( val currencyList: List = listOf(), val loading: Boolean = true, val selectionVisibility: Boolean = false -) : BaseState() +) : BaseState // Event interface CurrenciesEvent : BaseEvent { @@ -26,7 +26,7 @@ interface CurrenciesEvent : BaseEvent { } // Effect -sealed class CurrenciesEffect : BaseEffect() { +sealed class CurrenciesEffect : BaseEffect { data object FewCurrency : CurrenciesEffect() data object OpenCalculator : CurrenciesEffect() data object Back : CurrenciesEffect() @@ -37,4 +37,4 @@ sealed class CurrenciesEffect : BaseEffect() { data class CurrenciesData( var unFilteredList: MutableList = mutableListOf(), var query: String = "" -) : BaseData() +) : BaseData diff --git a/client/viewmodel/main/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/main/MainSEED.kt b/client/viewmodel/main/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/main/MainSEED.kt index fcf70031c3..b3ae057a6a 100644 --- a/client/viewmodel/main/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/main/MainSEED.kt +++ b/client/viewmodel/main/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/main/MainSEED.kt @@ -10,10 +10,10 @@ import kotlinx.coroutines.Job data class MainState( var shouldOnboardUser: Boolean, var appTheme: Int -) : BaseState() +) : BaseState // Effect -sealed class MainEffect : BaseEffect() { +sealed class MainEffect : BaseEffect { data object ShowInterstitialAd : MainEffect() data object RequestReview : MainEffect() data class AppUpdateEffect(val isCancelable: Boolean, val marketLink: String) : MainEffect() @@ -31,4 +31,4 @@ data class MainData( var adVisibility: Boolean = false, var isAppUpdateShown: Boolean = false, var isNewSession: Boolean = true -) : BaseData() +) : BaseData diff --git a/client/viewmodel/premium/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/premium/PremiumSEED.kt b/client/viewmodel/premium/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/premium/PremiumSEED.kt index fe4db35397..0c9bfaadd8 100644 --- a/client/viewmodel/premium/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/premium/PremiumSEED.kt +++ b/client/viewmodel/premium/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/premium/PremiumSEED.kt @@ -12,7 +12,7 @@ import com.oztechan.ccc.client.viewmodel.premium.model.PremiumType data class PremiumState( val premiumTypes: List = listOf(PremiumType.VIDEO), val loading: Boolean = true -) : BaseState() +) : BaseState // Event interface PremiumEvent : BaseEvent { @@ -29,7 +29,7 @@ interface PremiumEvent : BaseEvent { } // Effect -sealed class PremiumEffect : BaseEffect() { +sealed class PremiumEffect : BaseEffect { data class LaunchActivatePremiumFlow( val premiumType: PremiumType ) : PremiumEffect() diff --git a/client/viewmodel/selectcurrency/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt b/client/viewmodel/selectcurrency/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt index 2802d03983..468d37c91a 100644 --- a/client/viewmodel/selectcurrency/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt +++ b/client/viewmodel/selectcurrency/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/selectcurrency/SelectCurrencySEED.kt @@ -10,7 +10,7 @@ data class SelectCurrencyState( val loading: Boolean = true, val enoughCurrency: Boolean = false, val currencyList: List = listOf(), -) : BaseState() +) : BaseState // Event interface SelectCurrencyEvent : BaseEvent { @@ -19,7 +19,7 @@ interface SelectCurrencyEvent : BaseEvent { } // Effect -sealed class SelectCurrencyEffect : BaseEffect() { +sealed class SelectCurrencyEffect : BaseEffect { data class CurrencyChange(val newBase: String) : SelectCurrencyEffect() data object OpenCurrencies : SelectCurrencyEffect() } diff --git a/client/viewmodel/settings/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt b/client/viewmodel/settings/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt index 1259148fc7..67cad2f71a 100644 --- a/client/viewmodel/settings/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt +++ b/client/viewmodel/settings/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/settings/SettingsSEED.kt @@ -16,7 +16,7 @@ data class SettingsState( val premiumStatus: PremiumStatus = PremiumStatus.NeverActivated, val precision: Int = 0, val version: String = "" -) : BaseState() +) : BaseState // Event @Suppress("TooManyFunctions") @@ -37,7 +37,7 @@ interface SettingsEvent : BaseEvent { } // Effect -sealed class SettingsEffect : BaseEffect() { +sealed class SettingsEffect : BaseEffect { data object Back : SettingsEffect() data object OpenCurrencies : SettingsEffect() data object OpenWatchers : SettingsEffect() @@ -56,7 +56,7 @@ sealed class SettingsEffect : BaseEffect() { } // Data -data class SettingsData(var synced: Boolean = false) : BaseData() { +data class SettingsData(var synced: Boolean = false) : BaseData { companion object { internal const val SYNC_DELAY = 10.toLong() } diff --git a/client/viewmodel/watchers/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/watchers/WatchersSEED.kt b/client/viewmodel/watchers/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/watchers/WatchersSEED.kt index 753b6db28a..02845f1d61 100644 --- a/client/viewmodel/watchers/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/watchers/WatchersSEED.kt +++ b/client/viewmodel/watchers/src/commonMain/kotlin/com/oztechan/ccc/client/viewmodel/watchers/WatchersSEED.kt @@ -9,9 +9,9 @@ import com.oztechan.ccc.common.core.model.Watcher data class WatchersState( val isBannerAdVisible: Boolean, val watcherList: List = emptyList() -) : BaseState() +) : BaseState -sealed class WatchersEffect : BaseEffect() { +sealed class WatchersEffect : BaseEffect { data object Back : WatchersEffect() data class SelectBase(val watcher: Watcher) : WatchersEffect() data class SelectTarget(val watcher: Watcher) : WatchersEffect() @@ -32,7 +32,7 @@ interface WatchersEvent : BaseEvent { fun onRateChange(watcher: Watcher, rate: String): String } -class WatchersData : BaseData() { +class WatchersData : BaseData { companion object { const val MAXIMUM_INPUT = 9 const val MAXIMUM_NUMBER_OF_WATCHER = 5 diff --git a/gradle.properties b/gradle.properties index 7eba3ab183..468440197d 100755 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,5 @@ kotlin.incremental=true # KMP kotlin.mpp.stability.nowarn=true xcodeproj=./ios -# todo Need to get rid of having 2 static frameworks fails the build with Duplicate symbols -kotlin.native.cacheKind=none # todo this is only needed for res module but now way found for setting only 1 module android.nonTransitiveRClass=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 40123d555f..bfad26b84d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,31 +3,31 @@ kotlin = "1.9.10" ksp = "1.9.10-1.0.13" detekt = "1.23.1" -androidGradlePlugin = "8.1.1" +androidGradlePlugin = "8.1.2" composeCompiler = "1.5.3" -compose = "1.5.1" +compose = "1.5.2" glance = "1.0.0" -material3 = "1.1.1" +material3 = "1.1.2" androidDesugaring = "2.0.3" androidMaterial = "1.9.0" composeActivity = "1.7.2" constraintLayout = "2.1.4" -koinCore = "3.4.3" -koinCompose = "3.4.6" -koinAndroid = "3.4.3" -koinKtor = "3.4.3" +koinCore = "3.5.0" +koinCompose = "3.5.0" +koinAndroid = "3.5.0" +koinKtor = "3.5.1" ktor = "2.3.4" multiplatformSettings = "1.0.0" firebaseAnalytics = "21.3.0" firebaseRemoteConfig = "21.4.1" -gsm = "4.3.15" +gsm = "4.4.0" firebasePer = "20.4.1" firebasePerPlugin = "1.4.2" crashlytics = "2.9.9" -googleAds = "22.3.0" -huaweiAds = "3.4.65.303" +googleAds = "22.4.0" +huaweiAds = "3.4.66.301" huaweiOsm="1.3.35" -navigation = "2.7.2" +navigation = "2.7.3" playCore = "1.10.3" kotlinXDateTime = "0.4.1" coroutines = "1.7.3" @@ -41,9 +41,9 @@ splashScreen = "1.0.1" kover = "0.6.1" rootBeer = "0.1.0" mockative = "2.0.1" -firebaseCrashlytics = "18.4.1" +firebaseCrashlytics = "18.4.3" anrWatchDog = "1.4.0" -kermit = "1.2.2" +kermit = "2.0.1" [libraries] # COMMON @@ -134,7 +134,6 @@ classpaths-kover = { module = "org.jetbrains.kotlinx:kover", version.ref = "kove multiplatform = { id = "org.jetbrains.kotlin.multiplatform" } android = { id = "org.jetbrains.kotlin.android" } jvm = { id = "org.jetbrains.kotlin.jvm" } -cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods" } androidApp = { id = "com.android.application" } androidLib = { id = "com.android.library" } safeArgs = { id = "androidx.navigation.safeargs" } diff --git a/ios/.swiftlint.yml b/ios/.swiftlint.yml deleted file mode 100644 index 8d6f864025..0000000000 --- a/ios/.swiftlint.yml +++ /dev/null @@ -1,2 +0,0 @@ -excluded: - - Pods diff --git a/ios/CCC.xcodeproj/project.pbxproj b/ios/CCC.xcodeproj/project.pbxproj index 54cd2e481d..cd637617a7 100644 --- a/ios/CCC.xcodeproj/project.pbxproj +++ b/ios/CCC.xcodeproj/project.pbxproj @@ -3,11 +3,10 @@ archiveVersion = 1; classes = { }; - objectVersion = 53; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ - 15A796074B10DEA83142F40F /* Pods_CCC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 341CA58575E08166F616E331 /* Pods_CCC.framework */; }; 5C039FD625C1B705008350A3 /* FormProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C039FD525C1B705008350A3 /* FormProgressView.swift */; }; 5C0ABFDE2A9369A1002904AC /* CalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0ABFDD2A9369A1002904AC /* CalculatorView.swift */; }; 5C0ABFE02A9390D6002904AC /* CurrenciesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0ABFDF2A9390D6002904AC /* CurrenciesView.swift */; }; @@ -57,6 +56,7 @@ 5C9A59BB25C350DE006745B0 /* MainRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9A59BA25C350DE006745B0 /* MainRootView.swift */; }; 5C9C75C82603A36A00D66FDD /* ToolbarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */; }; 5CB954BF26932408007632DC /* AdaptiveBannerAdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB954BE26932408007632DC /* AdaptiveBannerAdView.swift */; }; + 5CBFC9472AC2E43800E2CE61 /* KermitExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CBFC9462AC2E43800E2CE61 /* KermitExt.swift */; }; 5CCFB5882A9B9F13002DF46B /* BugReportSlideRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCFB5872A9B9F13002DF46B /* BugReportSlideRootView.swift */; }; 5CCFB58A2A9B9F8F002DF46B /* IntroSlideRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCFB5892A9B9F8F002DF46B /* IntroSlideRootView.swift */; }; 5CCFB58C2A9B9FFA002DF46B /* PremiumSlideRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCFB58B2A9B9FFA002DF46B /* PremiumSlideRootView.swift */; }; @@ -90,7 +90,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 341CA58575E08166F616E331 /* Pods_CCC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CCC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5C039FD525C1B705008350A3 /* FormProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormProgressView.swift; sourceTree = ""; }; 5C0ABFDD2A9369A1002904AC /* CalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorView.swift; sourceTree = ""; }; 5C0ABFDF2A9390D6002904AC /* CurrenciesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrenciesView.swift; sourceTree = ""; }; @@ -138,6 +137,7 @@ 5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolbarButton.swift; sourceTree = ""; }; 5CACB69328A7EF1800A2D13C /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; 5CB954BE26932408007632DC /* AdaptiveBannerAdView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveBannerAdView.swift; sourceTree = ""; }; + 5CBFC9462AC2E43800E2CE61 /* KermitExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KermitExt.swift; sourceTree = ""; }; 5CCFB5872A9B9F13002DF46B /* BugReportSlideRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BugReportSlideRootView.swift; sourceTree = ""; }; 5CCFB5892A9B9F8F002DF46B /* IntroSlideRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntroSlideRootView.swift; sourceTree = ""; }; 5CCFB58B2A9B9FFA002DF46B /* PremiumSlideRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PremiumSlideRootView.swift; sourceTree = ""; }; @@ -154,8 +154,6 @@ 7555FF84242A565B00829871 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 7555FF87242A565B00829871 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CB3F2CB9B5D0920F890DA73A /* Pods-CCC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CCC.debug.xcconfig"; path = "Target Support Files/Pods-CCC/Pods-CCC.debug.xcconfig"; sourceTree = ""; }; - FF1FD2425A9A57DA8C484F81 /* Pods-CCC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CCC.release.xcconfig"; path = "Target Support Files/Pods-CCC/Pods-CCC.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -166,7 +164,6 @@ 5C34B8CA295903AD009C84AB /* PopupView in Frameworks */, 5CF0623228AD93CF00C579F6 /* FirebasePerformance in Frameworks */, 5C3EB6D828775AFF001E822A /* GoogleMobileAds in Frameworks */, - 15A796074B10DEA83142F40F /* Pods_CCC.framework in Frameworks */, 5CF0623028AD93CF00C579F6 /* FirebaseCrashlytics in Frameworks */, 5C5C0BA42874B8450061AEF9 /* NavigationStack in Frameworks */, 5CF0622E28AD93CF00C579F6 /* FirebaseAnalyticsSwift in Frameworks */, @@ -338,6 +335,7 @@ 5C5C71EC2922BFC400733C49 /* ConversionState.swift */, 5CEAF773295F2ECC0018C7FA /* DeviceUtil.swift */, 5C23124429ABF754002D6892 /* WindowUtil.swift */, + 5CBFC9462AC2E43800E2CE61 /* KermitExt.swift */, ); path = Util; sourceTree = ""; @@ -371,8 +369,6 @@ children = ( 7555FF7D242A565900829871 /* CCC */, 7555FF7C242A565900829871 /* Products */, - 7555FFB0242A642200829871 /* Frameworks */, - E1A41654A700B91B0C52E7DE /* Pods */, ); sourceTree = ""; }; @@ -407,23 +403,6 @@ path = "Preview Content"; sourceTree = ""; }; - 7555FFB0242A642200829871 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 341CA58575E08166F616E331 /* Pods_CCC.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1A41654A700B91B0C52E7DE /* Pods */ = { - isa = PBXGroup; - children = ( - CB3F2CB9B5D0920F890DA73A /* Pods-CCC.debug.xcconfig */, - FF1FD2425A9A57DA8C484F81 /* Pods-CCC.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -431,7 +410,6 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "CCC" */; buildPhases = ( - ABAB7B6EBA5C48167F3A008C /* [CP] Check Pods Manifest.lock */, 7555FFB5242A651A00829871 /* ShellScript */, 7555FF77242A565900829871 /* Sources */, 7555FF78242A565900829871 /* Frameworks */, @@ -546,29 +524,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint --no-cache\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n\ncd \"$SRCROOT/..\"\n\n\"$SRCROOT/../gradlew\" -p \"$SRCROOT/../\" :client:core:res:copyFrameworkResourcesToApp \\\n -Pmoko.resources.BUILT_PRODUCTS_DIR=\"$BUILT_PRODUCTS_DIR\" \\\n -Pmoko.resources.CONTENTS_FOLDER_PATH=\"$CONTENTS_FOLDER_PATH\" \\\n -Pkotlin.native.cocoapods.platform=\"$PLATFORM_NAME\" \\\n -Pkotlin.native.cocoapods.archs=\"$ARCHS\" \\\n -Pkotlin.native.cocoapods.configuration=\"$CONFIGURATION\"\n"; - }; - ABAB7B6EBA5C48167F3A008C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CCC-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint --no-cache\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n\ncd \"$SRCROOT/..\"\n\n\"$SRCROOT/../gradlew\" -p \"$SRCROOT/../\" \\\n :ios:provider:embedAndSignAppleFrameworkForXcode \\\n :client:core:res:embedAndSignAppleFrameworkForXcode \\\n :client:core:res:copyFrameworkResourcesToApp \\\n -Pmoko.resources.PLATFORM_NAME=\"$PLATFORM_NAME\" \\\n -Pmoko.resources.CONFIGURATION=\"$CONFIGURATION\" \\\n -Pmoko.resources.ARCHS=\"$ARCHS\" \\\n -Pmoko.resources.BUILT_PRODUCTS_DIR=\"$BUILT_PRODUCTS_DIR\" \\\n -Pmoko.resources.CONTENTS_FOLDER_PATH=\"$CONTENTS_FOLDER_PATH\" \n"; }; /* End PBXShellScriptBuildPhase section */ @@ -605,6 +561,7 @@ 5C31E42028141CA4008C42B9 /* OutputView.swift in Sources */, 5CEAF774295F2ECC0018C7FA /* DeviceUtil.swift in Sources */, 5C9A59BB25C350DE006745B0 /* MainRootView.swift in Sources */, + 5CBFC9472AC2E43800E2CE61 /* KermitExt.swift in Sources */, 5C34B8CC29590500009C84AB /* SnackView.swift in Sources */, 5C5D09362562EBDE00DA9C4A /* Koin.swift in Sources */, 5C23124529ABF754002D6892 /* WindowUtil.swift in Sources */, @@ -759,13 +716,17 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CB3F2CB9B5D0920F890DA73A /* Pods-CCC.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"CCC/Preview Content\""; DEVELOPMENT_TEAM = Q5WB95G58X; ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../ios/provider/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + "$(SRCROOT)/../client/core/res/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + ); GCC_GENERATE_DEBUGGING_SYMBOLS = NO; INFOPLIST_FILE = CCC/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -785,13 +746,17 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FF1FD2425A9A57DA8C484F81 /* Pods-CCC.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"CCC/Preview Content\""; DEVELOPMENT_TEAM = Q5WB95G58X; ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../ios/provider/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + "$(SRCROOT)/../client/core/res/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)", + ); INFOPLIST_FILE = CCC/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/CCC.xcworkspace/contents.xcworkspacedata b/ios/CCC.xcworkspace/contents.xcworkspacedata index bc57dc1be4..299b090cb3 100644 --- a/ios/CCC.xcworkspace/contents.xcworkspacedata +++ b/ios/CCC.xcworkspace/contents.xcworkspacedata @@ -24,7 +24,4 @@ location = "group:../res/src/iosMain"> - - diff --git a/ios/CCC/Application.swift b/ios/CCC/Application.swift index e8bbb33b52..c30136ff12 100644 --- a/ios/CCC/Application.swift +++ b/ios/CCC/Application.swift @@ -10,7 +10,6 @@ import BackgroundTasks import FirebaseCore import GoogleMobileAds import Provider -import Res import SwiftUI var logger: KermitLogger = { @@ -57,9 +56,9 @@ struct Application: App { MainRootView() .alert(isPresented: $isWatcherAlertShown) { AlertView( - title: Res.strings().txt_watcher_alert_title.get(), - message: Res.strings().txt_watcher_alert_sub_title.get(), - buttonText: Res.strings().txt_ok.get() + title: String(\.txt_watcher_alert_title), + message: String(\.txt_watcher_alert_sub_title), + buttonText: String(\.txt_ok) ) } }.onChange(of: scenePhase) { phase in @@ -109,8 +108,8 @@ struct Application: App { if backgroundRepository.shouldSendNotification() { if scenePhase == .background { self.notificationManager.sendNotification( - title: Res.strings().txt_watcher_alert_title.get(), - body: Res.strings().txt_watcher_alert_sub_title.get() + title: String(\.txt_watcher_alert_title), + body: String(\.txt_watcher_alert_sub_title) ) } else { isWatcherAlertShown.toggle() diff --git a/ios/CCC/Notification/NotificationManager.swift b/ios/CCC/Notification/NotificationManager.swift index 4cc31d00a9..e5813fc005 100644 --- a/ios/CCC/Notification/NotificationManager.swift +++ b/ios/CCC/Notification/NotificationManager.swift @@ -7,7 +7,6 @@ // import Provider -import Res import UserNotifications final class NotificationManager: ObservableObject { diff --git a/ios/CCC/UI/Calculator/CalculatorItemView.swift b/ios/CCC/UI/Calculator/CalculatorItemView.swift index ed7cce69d1..b660ec6a79 100644 --- a/ios/CCC/UI/Calculator/CalculatorItemView.swift +++ b/ios/CCC/UI/Calculator/CalculatorItemView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct CalculatorItemView: View { @@ -20,13 +19,13 @@ struct CalculatorItemView: View { HStack { Text(item.rate) .font(relative: .body) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .onTapGesture { onItemClick(item) } .onLongPressGesture { onItemAmountLongClick(item.rate) } Text(item.symbol) .font(relative: .subheadline) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .onTapGesture { onItemClick(item) } .onLongPressGesture { onItemAmountLongClick(item.rate) } @@ -34,7 +33,7 @@ struct CalculatorItemView: View { Text(item.code) .font(relative: .subheadline) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .onTapGesture { onItemClick(item) } .onLongPressGesture { onItemImageLongClick(item) } diff --git a/ios/CCC/UI/Calculator/CalculatorRootView.swift b/ios/CCC/UI/Calculator/CalculatorRootView.swift index 7dcc034855..a90d357d79 100644 --- a/ios/CCC/UI/Calculator/CalculatorRootView.swift +++ b/ios/CCC/UI/Calculator/CalculatorRootView.swift @@ -8,7 +8,6 @@ import NavigationStack import Provider -import Res import SwiftUI struct CalculatorRootView: View { @@ -41,34 +40,34 @@ struct CalculatorRootView: View { state: observable.state ) .snack(isPresented: $isTooBigInputSnackShown) { - SnackView(text: Res.strings().text_too_big_input.get()) + SnackView(text: String(\.text_too_big_input)) } .snack(isPresented: $isTooBigOutputSnackShown) { - SnackView(text: Res.strings().text_too_big_output.get()) + SnackView(text: String(\.text_too_big_output)) } .snack(isPresented: $isPasteRequestSnackShown) { SnackView( - text: Res.strings().text_paste_request.get(), - buttonText: Res.strings().text_paste.get(), + text: String(\.text_paste_request), + buttonText: String(\.text_paste), buttonAction: { observable.event.onPasteToInput(text: UIPasteboard.general.string ?? "") } ) } .snack(isPresented: $isGenericErrorSnackShown) { - SnackView(text: Res.strings().error_text_unknown.get()) + SnackView(text: String(\.error_text_unknown)) } .snack(isPresented: $isFewCurrencySnackShown) { SnackView( - text: Res.strings().choose_at_least_two_currency.get(), - buttonText: Res.strings().select.get(), + text: String(\.choose_at_least_two_currency), + buttonText: String(\.select), buttonAction: { navigationStack.push(CurrenciesRootView(onBaseChange: { observable.event.onBaseChange(base: $0) })) } ) } .snack(isPresented: $isCopyClipboardSnackShown) { - SnackView(text: Res.strings().copied_to_clipboard.get()) + SnackView(text: String(\.copied_to_clipboard)) } .snack(isPresented: $isConversionSnackShown) { if CalculatorRootView.conversionText != nil && CalculatorRootView.conversionCode != nil { diff --git a/ios/CCC/UI/Calculator/CalculatorView.swift b/ios/CCC/UI/Calculator/CalculatorView.swift index b929185dd4..6672b807bc 100644 --- a/ios/CCC/UI/Calculator/CalculatorView.swift +++ b/ios/CCC/UI/Calculator/CalculatorView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct CalculatorView: View { @@ -18,7 +17,7 @@ struct CalculatorView: View { var body: some View { ZStack { - Color(Res.colors().background_strong.get()).edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { InputView( @@ -55,10 +54,10 @@ struct CalculatorView: View { ) } .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) .animation(.default) } - .withClearBackground(color: Res.colors().background.get()) + .withClearBackground(color: Color(\.background)) .padding(bottom: 4.cp()) } @@ -77,6 +76,6 @@ struct CalculatorView: View { } } .navigationBarHidden(true) - .background(Res.colors().background_strong.get()) + .background(\.background_strong) } } diff --git a/ios/CCC/UI/Calculator/InputView.swift b/ios/CCC/UI/Calculator/InputView.swift index a17f9f4199..1eb10c38b6 100644 --- a/ios/CCC/UI/Calculator/InputView.swift +++ b/ios/CCC/UI/Calculator/InputView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct InputView: View { @@ -24,7 +23,7 @@ struct InputView: View { .multilineTextAlignment(.center) .lineLimit(2) .fixedSize(horizontal: false, vertical: true) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .title2) .animation(.none) .onLongPressGesture { diff --git a/ios/CCC/UI/Calculator/KeyboardView.swift b/ios/CCC/UI/Calculator/KeyboardView.swift index 35f470c802..902c90898a 100644 --- a/ios/CCC/UI/Calculator/KeyboardView.swift +++ b/ios/CCC/UI/Calculator/KeyboardView.swift @@ -6,19 +6,18 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct KeyboardView: View { var onKeyPress: (String) -> Void private let keys = [ - [Res.strings().seven.get(), Res.strings().eight.get(), Res.strings().nine.get(), Res.strings().multiply.get()], - [Res.strings().four.get(), Res.strings().five.get(), Res.strings().six.get(), Res.strings().divide.get()], - [Res.strings().one.get(), Res.strings().two.get(), Res.strings().three.get(), Res.strings().minus.get()], - [Res.strings().dot.get(), Res.strings().zero.get(), Res.strings().percent.get(), Res.strings().plus.get()], + [String(\.seven), String(\.eight), String(\.nine), String(\.multiply)], + [String(\.four), String(\.five), String(\.six), String(\.divide)], + [String(\.one), String(\.two), String(\.three), String(\.minus)], + [String(\.dot), String(\.zero), String(\.percent), String(\.plus)], // swiftlint:disable:next line_length - [Res.strings().open_parentheses.get(), Res.strings().triple_zero.get(), Res.strings().ac.get(), Res.strings().delete_.get(), Res.strings().close_parentheses.get()] + [String(\.open_parentheses), String(\.triple_zero), String(\.ac), String(\.delete_), String(\.close_parentheses)] ] var body: some View { @@ -31,13 +30,13 @@ struct KeyboardView: View { label: { Text(item) .font(relative: .title2) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) } ) } } } - }.background(Res.colors().background_strong.get()) + }.background(\.background_strong) } } diff --git a/ios/CCC/UI/Calculator/OutputView.swift b/ios/CCC/UI/Calculator/OutputView.swift index 74f20a99b7..e65e3785eb 100644 --- a/ios/CCC/UI/Calculator/OutputView.swift +++ b/ios/CCC/UI/Calculator/OutputView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct OutputView: View { @@ -22,12 +21,12 @@ struct OutputView: View { CurrencyImageView(imageName: baseCurrency) Text(baseCurrency) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .body) if !output.isEmpty { Text("= \(output)") - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .body) .onTapGesture { onBarClick() @@ -38,7 +37,7 @@ struct OutputView: View { } Text(symbol) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .body) } .frame(minWidth: 0, maxWidth: .infinity, alignment: .bottomLeading) diff --git a/ios/CCC/UI/Components/ActionButton.swift b/ios/CCC/UI/Components/ActionButton.swift index 8dff254137..cfa08b146e 100644 --- a/ios/CCC/UI/Components/ActionButton.swift +++ b/ios/CCC/UI/Components/ActionButton.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct ActionButton: View { @@ -43,20 +42,20 @@ struct ActionButton: View { private func getBackgroundColor() -> Color { switch state { case .primary: - return Res.colors().primary.get() + return Color(\.primary) case .secondary: - return Res.colors().text.get() + return Color(\.text) case .neutral: - return Res.colors().background_weak.get() + return Color(\.background_weak) } } private func getTextColor() -> Color { switch state { case .primary, .secondary: - return Res.colors().background_weak.get() + return Color(\.background_weak) case .neutral: - return Res.colors().text.get() + return Color(\.text) } } } diff --git a/ios/CCC/UI/Components/AlertView.swift b/ios/CCC/UI/Components/AlertView.swift index 524f27e522..63840e2169 100644 --- a/ios/CCC/UI/Components/AlertView.swift +++ b/ios/CCC/UI/Components/AlertView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct AlertView: View { @@ -20,12 +19,12 @@ struct AlertView: View { var body: some View { VStack { Text(title) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .headline) .padding(bottom: 20.cp()) Text(message) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .subheadline) .multilineTextAlignment(.center) .padding(bottom: 30.cp()) @@ -33,7 +32,7 @@ struct AlertView: View { HStack { if isCancellable == true { ActionButton( - buttonText: Res.strings().cancel.get(), + buttonText: String(\.cancel), buttonAction: {}, state: .secondary ) @@ -47,7 +46,7 @@ struct AlertView: View { } } .padding(20.cp()) - .background(Res.colors().background_weak.get()) + .background(\.background_weak) .cornerRadius(10.cp()) .shadow(radius: 5) .padding(30.cp()) diff --git a/ios/CCC/UI/Components/CurrencyImageView.swift b/ios/CCC/UI/Components/CurrencyImageView.swift index 89ca946e5a..f2591df037 100644 --- a/ios/CCC/UI/Components/CurrencyImageView.swift +++ b/ios/CCC/UI/Components/CurrencyImageView.swift @@ -12,7 +12,7 @@ struct CurrencyImageView: View { let imageName: String var body: some View { - Image(uiImage: imageName.getImage()) + Image(imageName: imageName) .resize(widthAndHeight: 36.cp()) .shadow(radius: 3) } diff --git a/ios/CCC/UI/Components/FormProgressView.swift b/ios/CCC/UI/Components/FormProgressView.swift index aee3159c1d..3ca5e49020 100644 --- a/ios/CCC/UI/Components/FormProgressView.swift +++ b/ios/CCC/UI/Components/FormProgressView.swift @@ -6,7 +6,6 @@ // Copyright © 2021 orgName. All rights reserved. // -import Res import SwiftUI struct FormProgressView: View { @@ -27,6 +26,6 @@ struct FormProgressView: View { Spacer() } .padding(.top, 20.cp()) - .background(Res.colors().background.get()) + .background(\.background) } } diff --git a/ios/CCC/UI/Components/MailView.swift b/ios/CCC/UI/Components/MailView.swift index 6ccc00a78c..6dfa63bc1c 100644 --- a/ios/CCC/UI/Components/MailView.swift +++ b/ios/CCC/UI/Components/MailView.swift @@ -7,7 +7,6 @@ // import MessageUI -import Res import SwiftUI struct MailView: UIViewControllerRepresentable { @@ -40,9 +39,9 @@ struct MailView: UIViewControllerRepresentable { func makeUIViewController(context: UIViewControllerRepresentableContext) -> MFMailComposeViewController { let controller = MFMailComposeViewController() controller.mailComposeDelegate = context.coordinator - controller.setToRecipients([Res.strings().mail_developer.get()]) - controller.setSubject(Res.strings().mail_feedback_subject.get()) - controller.setMessageBody(Res.strings().mail_extra_text.get(), isHTML: false) + controller.setToRecipients([String(\.mail_developer)]) + controller.setSubject(String(\.mail_feedback_subject)) + controller.setMessageBody(String(\.mail_extra_text), isHTML: false) return controller } diff --git a/ios/CCC/UI/Components/SelectCurrenciesBottomView.swift b/ios/CCC/UI/Components/SelectCurrenciesBottomView.swift index ddd195493c..f573eaa754 100644 --- a/ios/CCC/UI/Components/SelectCurrenciesBottomView.swift +++ b/ios/CCC/UI/Components/SelectCurrenciesBottomView.swift @@ -6,7 +6,6 @@ // Copyright © 2021 orgName. All rights reserved. // -import Res import SwiftUI struct SelectCurrenciesBottomView: View { @@ -19,7 +18,7 @@ struct SelectCurrenciesBottomView: View { var body: some View { HStack { Text(text) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .subheadline) Spacer() diff --git a/ios/CCC/UI/Components/SnackView.swift b/ios/CCC/UI/Components/SnackView.swift index 957eea1a6a..e687049ef7 100644 --- a/ios/CCC/UI/Components/SnackView.swift +++ b/ios/CCC/UI/Components/SnackView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct SnackView: View { @@ -19,11 +18,14 @@ struct SnackView: View { var body: some View { HStack { - Image(uiImage: iconName?.getImage() ?? Res.images().ic_app_logo.get()) - .resize(widthAndHeight: 48.cp()) + if iconName == nil { + Image(resourceKey: \.ic_app_logo).resize(widthAndHeight: 48.cp()) + } else { + Image(imageName: iconName!).resize(widthAndHeight: 48.cp()) + } Text(text) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .font(relative: .subheadline) .padding(leading: 5.cp()) @@ -38,7 +40,7 @@ struct SnackView: View { } } .padding(10.cp()) - .background(Res.colors().background_weak.get()) + .background(\.background_weak) .cornerRadius(10.cp()) .shadow(radius: 5) .padding(10.cp()) diff --git a/ios/CCC/UI/Components/ToolbarButton.swift b/ios/CCC/UI/Components/ToolbarButton.swift index 96f4ac598f..dbe5f477d3 100644 --- a/ios/CCC/UI/Components/ToolbarButton.swift +++ b/ios/CCC/UI/Components/ToolbarButton.swift @@ -6,7 +6,6 @@ // Copyright © 2021 orgName. All rights reserved. // -import Res import SwiftUI struct ToolbarButton: View { @@ -21,7 +20,7 @@ struct ToolbarButton: View { label: { Image(systemName: imgName) .resize(widthAndHeight: 24.cp()) - .accentColor(Res.colors().text.get()) + .accentColor(\.text) .padding(.leading, 10.cp()) } ).padding(.trailing, 10.cp()) diff --git a/ios/CCC/UI/Currencies/CurrenciesItemView.swift b/ios/CCC/UI/Currencies/CurrenciesItemView.swift index 37176911ec..08e0b2da3a 100644 --- a/ios/CCC/UI/Currencies/CurrenciesItemView.swift +++ b/ios/CCC/UI/Currencies/CurrenciesItemView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct CurrenciesItemView: View { @@ -23,21 +22,21 @@ struct CurrenciesItemView: View { Text(item.code) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Text(item.name) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Text(item.symbol) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Spacer() Image(systemName: item.isActive ? "checkmark.circle.fill" : "circle") .resize(widthAndHeight: 20.cp()) - .foregroundColor(Res.colors().secondary.get()) + .foregroundColor(\.secondary) } .contentShape(Rectangle()) .padding(.vertical, 4.cp()) diff --git a/ios/CCC/UI/Currencies/CurrenciesRootView.swift b/ios/CCC/UI/Currencies/CurrenciesRootView.swift index 5d52f79d80..71e6e6e156 100644 --- a/ios/CCC/UI/Currencies/CurrenciesRootView.swift +++ b/ios/CCC/UI/Currencies/CurrenciesRootView.swift @@ -8,7 +8,6 @@ import NavigationStack import Provider -import Res import SwiftUI struct CurrenciesRootView: View { @@ -32,7 +31,7 @@ struct CurrenciesRootView: View { event: observable.event, state: observable.state ).snack(isPresented: $isFewCurrencySnackShown) { - SnackView(text: Res.strings().choose_at_least_two_currency.get()) + SnackView(text: String(\.choose_at_least_two_currency)) } .onAppear { observable.startObserving() diff --git a/ios/CCC/UI/Currencies/CurrenciesToolbarView.swift b/ios/CCC/UI/Currencies/CurrenciesToolbarView.swift index 05e606c296..50bd67e04d 100644 --- a/ios/CCC/UI/Currencies/CurrenciesToolbarView.swift +++ b/ios/CCC/UI/Currencies/CurrenciesToolbarView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct CurrenciesToolbarView: View { @@ -28,13 +27,13 @@ struct CurrenciesToolbarView: View { if searchVisibilty { Spacer() - TextField(Res.strings().search.get(), text: $query) + TextField(String(\.search), text: $query) .font(relative: .headline) .onChange(of: query) { onQueryChange($0) } .padding(8.cp()) .background( RoundedRectangle(cornerRadius: 3.cp()) - .fill(Res.colors().background.get()) + .fill(Color(\.background)) ) .disableAutocorrection(true) .multilineTextAlignment(.center) @@ -51,7 +50,7 @@ struct CurrenciesToolbarView: View { imgName: "xmark" ) } else { - Text(Res.strings().txt_currencies.get()).font(relative: .title3) + Text(String(\.txt_currencies)).font(relative: .title3) Spacer() diff --git a/ios/CCC/UI/Currencies/CurrenciesView.swift b/ios/CCC/UI/Currencies/CurrenciesView.swift index 2fb2a555c2..d0695f2ce3 100644 --- a/ios/CCC/UI/Currencies/CurrenciesView.swift +++ b/ios/CCC/UI/Currencies/CurrenciesView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct CurrenciesView: View { @@ -18,7 +17,7 @@ struct CurrenciesView: View { var body: some View { ZStack { - Res.colors().background_strong.get().edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { if state.selectionVisibility { @@ -47,15 +46,15 @@ struct CurrenciesView: View { } .listRowInsets(.init()) .id(UUID()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) } - .withClearBackground(color: Res.colors().background.get()) + .withClearBackground(color: Color(\.background)) } if state.isOnboardingVisible { SelectCurrenciesBottomView( - text: Res.strings().txt_select_currencies.get(), - buttonText: Res.strings().btn_done.get(), + text: String(\.txt_select_currencies), + buttonText: String(\.btn_done), onButtonClick: event.onDoneClick ) } diff --git a/ios/CCC/UI/Currencies/SelectionView.swift b/ios/CCC/UI/Currencies/SelectionView.swift index 9ba069a995..7c31996eca 100644 --- a/ios/CCC/UI/Currencies/SelectionView.swift +++ b/ios/CCC/UI/Currencies/SelectionView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct SelectionView: View { @@ -22,23 +21,23 @@ struct SelectionView: View { Button( action: { updateAllCurrenciesState(true) }, label: { - Text(Res.strings().btn_select_all.get()) + Text(String(\.btn_select_all)) .font(relative: .headline) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) } ).padding(.trailing, 10.cp()) Button( action: { updateAllCurrenciesState(false) }, label: { - Text(Res.strings().btn_de_select_all.get()) + Text(String(\.btn_de_select_all)) .font(relative: .headline) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) } ) } .padding(top: 15.cp(), leading: 10.cp(), bottom: 15.cp(), trailing: 20.cp()) - .background(Res.colors().background_weak.get()) + .background(\.background_weak) .frame(maxHeight: 54.cp(), alignment: .bottom) } } diff --git a/ios/CCC/UI/Main/MainRootView.swift b/ios/CCC/UI/Main/MainRootView.swift index 79526c2afe..10b98385da 100644 --- a/ios/CCC/UI/Main/MainRootView.swift +++ b/ios/CCC/UI/Main/MainRootView.swift @@ -9,7 +9,6 @@ import GoogleMobileAds import NavigationStack import Provider -import Res import SwiftUI struct MainRootView: View { diff --git a/ios/CCC/UI/Premium/PremiumItemView.swift b/ios/CCC/UI/Premium/PremiumItemView.swift index c2c932651c..a9a26e5ba8 100644 --- a/ios/CCC/UI/Premium/PremiumItemView.swift +++ b/ios/CCC/UI/Premium/PremiumItemView.swift @@ -8,7 +8,6 @@ import SwiftUI import Provider -import Res struct PremiumItemView: View { @Environment(\.colorScheme) private var colorScheme @@ -20,21 +19,21 @@ struct PremiumItemView: View { if item == nil { Spacer() - Text(Res.strings().txt_more_options_are_coming.get()) + Text(String(\.txt_more_options_are_coming)) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Spacer() } else { Text(item!.data.duration) .font(relative: .callout) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Spacer() Text(item!.data.cost) .font(relative: .callout) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) } } .contentShape(Rectangle()) diff --git a/ios/CCC/UI/Premium/PremiumRootView.swift b/ios/CCC/UI/Premium/PremiumRootView.swift index 1430130e64..36a4e475be 100644 --- a/ios/CCC/UI/Premium/PremiumRootView.swift +++ b/ios/CCC/UI/Premium/PremiumRootView.swift @@ -6,7 +6,6 @@ // Copyright © 2023 orgName. All rights reserved. // -import Res import Provider import SwiftUI @@ -31,9 +30,9 @@ struct PremiumRootView: View { ) .alert(isPresented: $isPremiumDialogShown) { AlertView( - title: Res.strings().txt_premium.get(), - message: Res.strings().txt_premium_text.get(), - buttonText: Res.strings().txt_watch.get(), + title: String(\.txt_premium), + message: String(\.txt_premium_text), + buttonText: String(\.txt_watch), buttonAction: { RewardedAd( onReward: { diff --git a/ios/CCC/UI/Premium/PremiumView.swift b/ios/CCC/UI/Premium/PremiumView.swift index 27e25d9898..a00cf5bcd5 100644 --- a/ios/CCC/UI/Premium/PremiumView.swift +++ b/ios/CCC/UI/Premium/PremiumView.swift @@ -6,7 +6,6 @@ // Copyright © 2023 orgName. All rights reserved. // -import Res import Provider import SwiftUI @@ -18,10 +17,10 @@ struct PremiumView: View { var body: some View { ZStack { - Color(Res.colors().background_strong.get()).edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { - Text(Res.strings().txt_premium.get()) + Text(String(\.txt_premium)) .font(relative: .title2) .padding(4.cp()) .padding(.top, 10.cp()) @@ -38,13 +37,13 @@ struct PremiumView: View { .frame(minWidth: 0, maxWidth: .infinity, alignment: .center) } .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) PremiumItemView(item: nil) .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) } - .withClearBackground(color: Res.colors().background.get()) + .withClearBackground(color: Color(\.background)) } Spacer() diff --git a/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift index f4b0640f07..3594da1f0a 100644 --- a/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyItemView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct SelectCurrencyItemView: View { @@ -20,15 +19,15 @@ struct SelectCurrencyItemView: View { Text(item.code) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Text(item.name) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Text(item.symbol) .font(relative: .footnote) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) Spacer() } diff --git a/ios/CCC/UI/SelectCurrency/SelectCurrencyRootView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyRootView.swift index ff10086610..7523992979 100644 --- a/ios/CCC/UI/SelectCurrency/SelectCurrencyRootView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyRootView.swift @@ -8,7 +8,6 @@ import NavigationStack import Provider -import Res import SwiftUI struct SelectCurrencyRootView: View { diff --git a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift index f2369c3e30..3d75343009 100644 --- a/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift +++ b/ios/CCC/UI/SelectCurrency/SelectCurrencyView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct SelectCurrencyView: View { @@ -18,10 +17,10 @@ struct SelectCurrencyView: View { var body: some View { ZStack { - Color(Res.colors().background_strong.get()).edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { - Text(Res.strings().txt_select_base_currency.get()) + Text(String(\.txt_select_base_currency)) .font(relative: .title2) .padding(4.cp()) .padding(.top, 10.cp()) @@ -36,22 +35,20 @@ struct SelectCurrencyView: View { .frame(minWidth: 0, maxWidth: .infinity, alignment: .center) } .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) } - .withClearBackground(color: Res.colors().background.get()) + .withClearBackground(color: Color(\.background)) } Spacer() SelectCurrenciesBottomView( text: state.enoughCurrency ? - Res.strings().txt_update_favorite_currencies.get() : - Res.strings().choose_at_least_two_currency.get(), - buttonText: state.enoughCurrency ? - Res.strings().update.get() : - Res.strings().select.get(), + String(\.txt_update_favorite_currencies) : + String(\.choose_at_least_two_currency), + buttonText: state.enoughCurrency ? String(\.update) : String(\.select), onButtonClick: event.onSelectClick - ).listRowBackground(Res.colors().background.get()) + ).listRowBackground(\.background) }.navigationBarHidden(true) } } diff --git a/ios/CCC/UI/Settings/SettingsItemView.swift b/ios/CCC/UI/Settings/SettingsItemView.swift index 8860568cf0..0b1230345e 100644 --- a/ios/CCC/UI/Settings/SettingsItemView.swift +++ b/ios/CCC/UI/Settings/SettingsItemView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct SettingsItemView: View { @@ -23,7 +22,7 @@ struct SettingsItemView: View { .frame(width: 48.cp(), height: 48.cp(), alignment: .center) .font(size: 24.cp()) .imageScale(.large) - .accentColor(Res.colors().text.get()) + .accentColor(\.text) .padding(top: 8.cp(), leading: 0, bottom: 8.cp(), trailing: 8.cp()) VStack { @@ -50,10 +49,10 @@ struct SettingsItemView: View { Image(systemName: "chevron.right") .frame(width: 48.cp(), height: 48.cp(), alignment: .center) .imageScale(.large) - .accentColor(Res.colors().text.get()) + .accentColor(\.text) } .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) + .listRowBackground(\.background) .contentShape(Rectangle()) .onTapGesture { onClick() } .lineLimit(1) diff --git a/ios/CCC/UI/Settings/SettingsRootView.swift b/ios/CCC/UI/Settings/SettingsRootView.swift index 3a4d7ffd0c..42427f48a7 100644 --- a/ios/CCC/UI/Settings/SettingsRootView.swift +++ b/ios/CCC/UI/Settings/SettingsRootView.swift @@ -9,7 +9,6 @@ import GoogleMobileAds import NavigationStack import Provider -import Res import SwiftUI struct SettingsRootView: View { @@ -40,16 +39,16 @@ struct SettingsRootView: View { state: observable.state ) .snack(isPresented: $isAdsAlreadyDisabledSnackShown) { - SnackView(text: Res.strings().txt_you_already_have_premium.get()) + SnackView(text: String(\.txt_you_already_have_premium)) } .snack(isPresented: $isAlreadySyncedSnackShown) { - SnackView(text: Res.strings().txt_already_synced.get()) + SnackView(text: String(\.txt_already_synced)) } .snack(isPresented: $isSynchronisingShown) { - SnackView(text: Res.strings().txt_synchronising.get()) + SnackView(text: String(\.txt_synchronising)) } .snack(isPresented: $isSyncedSnackShown) { - SnackView(text: Res.strings().txt_synced.get()) + SnackView(text: String(\.txt_synced)) } .sheet(isPresented: $premiumViewVisibility) { PremiumRootView(premiumViewVisibility: $premiumViewVisibility) @@ -58,7 +57,7 @@ struct SettingsRootView: View { MailView(isShowing: $emailViewVisibility) } .sheet(isPresented: $webViewVisibility) { - WebView(url: NSURL(string: Res.strings().github_url.get())! as URL) + WebView(url: NSURL(string: String(\.github_url))! as URL) } .onAppear { observable.startObserving() diff --git a/ios/CCC/UI/Settings/SettingsToolbarView.swift b/ios/CCC/UI/Settings/SettingsToolbarView.swift index 8cf7320153..6e0b676e8c 100644 --- a/ios/CCC/UI/Settings/SettingsToolbarView.swift +++ b/ios/CCC/UI/Settings/SettingsToolbarView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct SettingsToolbarView: View { @@ -16,7 +15,7 @@ struct SettingsToolbarView: View { HStack { ToolbarButton(clickEvent: backEvent, imgName: "chevron.left") - Text(Res.strings().txt_settings.get()) + Text(String(\.txt_settings)) .font(relative: .title3) Spacer() diff --git a/ios/CCC/UI/Settings/SettingsView.swift b/ios/CCC/UI/Settings/SettingsView.swift index 0e034a4212..cb711f49b3 100644 --- a/ios/CCC/UI/Settings/SettingsView.swift +++ b/ios/CCC/UI/Settings/SettingsView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct SettingsView: View { @@ -18,7 +17,7 @@ struct SettingsView: View { var body: some View { ZStack { - Res.colors().background_strong.get().edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { SettingsToolbarView(backEvent: event.onBackClick) @@ -26,36 +25,32 @@ struct SettingsView: View { Form { SettingsItemView( imgName: "dollarsign.circle.fill", - title: Res.strings().settings_item_currencies_title.get(), - subTitle: Res.strings().settings_item_currencies_sub_title.get(), - value: Res.strings().settings_active_item_value.get( - parameter: state.activeCurrencyCount - ), + title: String(\.settings_item_currencies_title), + subTitle: String(\.settings_item_currencies_sub_title), + value: String(\.settings_active_item_value, parameter: state.activeCurrencyCount), onClick: event.onCurrenciesClick ) SettingsItemView( imgName: "eyeglasses", - title: Res.strings().settings_item_watchers_title.get(), - subTitle: Res.strings().settings_item_watchers_sub_title.get(), - value: Res.strings().settings_active_item_value.get( - parameter: state.activeWatcherCount - ), + title: String(\.settings_item_watchers_title), + subTitle: String(\.settings_item_watchers_sub_title), + value: String(\.settings_active_item_value, parameter: state.activeWatcherCount), onClick: event.onWatchersClick ) SettingsItemView( imgName: "crown.fill", - title: Res.strings().settings_item_premium_title.get(), - subTitle: Res.strings().settings_item_premium_sub_title_no_ads.get(), + title: String(\.settings_item_premium_title), + subTitle: String(\.settings_item_premium_sub_title_no_ads), value: getPremiumText(premiumStatus: state.premiumStatus), onClick: event.onPremiumClick ) SettingsItemView( imgName: "arrow.2.circlepath.circle.fill", - title: Res.strings().settings_item_sync_title.get(), - subTitle: Res.strings().settings_item_sync_sub_title.get(), + title: String(\.settings_item_sync_title), + subTitle: String(\.settings_item_sync_sub_title), value: "", onClick: event.onSyncClick ) @@ -63,8 +58,8 @@ struct SettingsView: View { if MailView.canSendEmail() { SettingsItemView( imgName: "envelope.fill", - title: Res.strings().settings_item_feedback_title.get(), - subTitle: Res.strings().settings_item_feedback_sub_title.get(), + title: String(\.settings_item_feedback_title), + subTitle: String(\.settings_item_feedback_sub_title), value: "", onClick: event.onFeedBackClick ) @@ -72,21 +67,21 @@ struct SettingsView: View { SettingsItemView( imgName: "chevron.left.slash.chevron.right", - title: Res.strings().settings_item_on_github_title.get(), - subTitle: Res.strings().settings_item_on_github_sub_title.get(), + title: String(\.settings_item_on_github_title), + subTitle: String(\.settings_item_on_github_sub_title), value: "", onClick: event.onOnGitHubClick ) SettingsItemView( imgName: "textformat.123", - title: Res.strings().settings_item_version_title.get(), - subTitle: Res.strings().settings_item_version_sub_title.get(), + title: String(\.settings_item_version_title), + subTitle: String(\.settings_item_version_sub_title), value: state.version, onClick: {} ) }.edgesIgnoringSafeArea(.bottom) - .withClearBackground(color: Res.colors().background.get()) + .withClearBackground(color: Color(\.background)) if state.isBannerAdVisible { AdaptiveBannerAdView(unitID: "BANNER_AD_UNIT_ID_SETTINGS").adapt() @@ -103,9 +98,9 @@ struct SettingsView: View { case is PremiumStatus.NeverActivated: return "" case let activateStatus as PremiumStatus.Active: - return Res.strings().settings_item_premium_value_will_expire.get(parameter: activateStatus.until) + return String(\.settings_item_premium_value_will_expire, parameter: activateStatus.until) case let expiredStatus as PremiumStatus.Expired: - return Res.strings().settings_item_premium_value_expired.get(parameter: expiredStatus.at) + return String(\.settings_item_premium_value_expired, parameter: expiredStatus.at) default: return "" } diff --git a/ios/CCC/UI/Slides/BugReportSlideRootView.swift b/ios/CCC/UI/Slides/BugReportSlideRootView.swift index 0f2263c05a..593e24c6e9 100644 --- a/ios/CCC/UI/Slides/BugReportSlideRootView.swift +++ b/ios/CCC/UI/Slides/BugReportSlideRootView.swift @@ -6,7 +6,6 @@ // Copyright © 2023 orgName. All rights reserved. // -import Res import SwiftUI import NavigationStack import Provider @@ -20,11 +19,11 @@ struct BugReportSlideRootView: View { var body: some View { SlideView( - title: Res.strings().slide_bug_report_title.get(), + title: String(\.slide_bug_report_title), image: Image(systemName: "ant.fill"), - subTitle1: Res.strings().slide_bug_report_text_1.get(), - subTitle2: Res.strings().slide_bug_report_text_2.get(), - buttonText: Res.strings().got_it.get(), + subTitle1: String(\.slide_bug_report_text_1), + subTitle2: String(\.slide_bug_report_text_2), + buttonText: String(\.got_it), buttonAction: { navigationStack.push(CurrenciesRootView(onBaseChange: { _ in })) } ) .onAppear { diff --git a/ios/CCC/UI/Slides/IntroSlideRootView.swift b/ios/CCC/UI/Slides/IntroSlideRootView.swift index 931c0f96b8..6135d8a77b 100644 --- a/ios/CCC/UI/Slides/IntroSlideRootView.swift +++ b/ios/CCC/UI/Slides/IntroSlideRootView.swift @@ -6,7 +6,6 @@ // Copyright © 2023 orgName. All rights reserved. // -import Res import SwiftUI import NavigationStack import Provider @@ -20,11 +19,11 @@ struct IntroSlideRootView: View { var body: some View { SlideView( - title: Res.strings().slide_intro_title.get(), - image: Image(uiImage: Res.images().ic_app_logo.get()), - subTitle1: Res.strings().slide_intro_text.get(), + title: String(\.slide_intro_title), + image: Image(resourceKey: \.ic_app_logo), + subTitle1: String(\.slide_intro_text), subTitle2: "", - buttonText: Res.strings().next.get(), + buttonText: String(\.next), buttonAction: { navigationStack.push(PremiumSlideRootView()) } ).onAppear { analyticsManager.trackScreen(screenName: ScreenName.Slider(position: 0)) diff --git a/ios/CCC/UI/Slides/PremiumSlideRootView.swift b/ios/CCC/UI/Slides/PremiumSlideRootView.swift index 9b6d882295..80c2eca438 100644 --- a/ios/CCC/UI/Slides/PremiumSlideRootView.swift +++ b/ios/CCC/UI/Slides/PremiumSlideRootView.swift @@ -6,7 +6,6 @@ // Copyright © 2023 orgName. All rights reserved. // -import Res import SwiftUI import NavigationStack import Provider @@ -20,11 +19,11 @@ struct PremiumSlideRootView: View { var body: some View { SlideView( - title: Res.strings().slide_premium_title.get(), + title: String(\.slide_premium_title), image: Image(systemName: "crown.fill"), - subTitle1: Res.strings().slide_premium_text_1_no_ads.get(), - subTitle2: Res.strings().slide_premium_text_2.get(), - buttonText: Res.strings().next.get(), + subTitle1: String(\.slide_premium_text_1_no_ads), + subTitle2: String(\.slide_premium_text_2), + buttonText: String(\.next), buttonAction: { navigationStack.push(BugReportSlideRootView()) } ).onAppear { analyticsManager.trackScreen(screenName: ScreenName.Slider(position: 1)) diff --git a/ios/CCC/UI/Slides/SlideView.swift b/ios/CCC/UI/Slides/SlideView.swift index 1552f09578..2f40ad05c6 100644 --- a/ios/CCC/UI/Slides/SlideView.swift +++ b/ios/CCC/UI/Slides/SlideView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct SlideView: View { @@ -21,7 +20,7 @@ struct SlideView: View { var body: some View { ZStack { - Color(Res.colors().background_strong.get()).edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { Spacer() @@ -31,7 +30,7 @@ struct SlideView: View { image .resize(widthAndHeight: 144.cp()) - .accentColor(Res.colors().text.get()) + .accentColor(\.text) .padding(4.cp()) Text(subTitle1) @@ -59,7 +58,7 @@ struct SlideView: View { label: { Text(buttonText) .font(relative: .body) - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) } ).padding(top: 10.cp(), leading: 10.cp(), bottom: 15.cp(), trailing: 15.cp()) } diff --git a/ios/CCC/UI/Watchers/WatcherItem.swift b/ios/CCC/UI/Watchers/WatcherItem.swift index ff6f8dbeef..22324b5fcb 100644 --- a/ios/CCC/UI/Watchers/WatcherItem.swift +++ b/ios/CCC/UI/Watchers/WatcherItem.swift @@ -9,7 +9,6 @@ import Combine import NavigationStack import Provider -import Res import SwiftUI struct WatcherItem: View { @@ -25,16 +24,16 @@ struct WatcherItem: View { var body: some View { HStack { - Text(Res.strings().one.get()).font(relative: .body) + Text(String(\.one)).font(relative: .body) CurrencyImageView(imageName: watcher.base) .onTapGesture { event.onBaseClick(watcher: watcher) } Picker("", selection: $relationSelection) { - Text(Res.strings().txt_smaller.get()) + Text(String(\.txt_smaller)) .font(relative: .title) .tag(0) - Text(Res.strings().txt_grater.get()) + Text(String(\.txt_grater)) .font(relative: .title) .tag(1) } @@ -46,14 +45,14 @@ struct WatcherItem: View { Spacer() - TextField(Res.strings().txt_rate.get(), text: $amount) + TextField(String(\.txt_rate), text: $amount) .keyboardType(.decimalPad) .font(relative: .body) .multilineTextAlignment(TextAlignment.center) .fixedSize() .lineLimit(1) .padding(top: 5.cp(), leading: 15.cp(), bottom: 5.cp(), trailing: 15.cp()) - .background(Res.colors().background_weak.get()) + .background(\.background_weak) .cornerRadius(7.cp()) .onChange(of: amount) { amount = event.onRateChange(watcher: watcher, rate: $0) diff --git a/ios/CCC/UI/Watchers/WatchersRootView.swift b/ios/CCC/UI/Watchers/WatchersRootView.swift index 0b34d67ee2..a8983c2f84 100644 --- a/ios/CCC/UI/Watchers/WatchersRootView.swift +++ b/ios/CCC/UI/Watchers/WatchersRootView.swift @@ -8,7 +8,6 @@ import NavigationStack import Provider -import Res import SwiftUI struct WatchersRootView: View { @@ -39,13 +38,13 @@ struct WatchersRootView: View { targetBarInfo: $targetBarInfo ) .snack(isPresented: $isInvalidInputSnackShown) { - SnackView(text: Res.strings().text_invalid_input.get()) + SnackView(text: String(\.text_invalid_input)) } .snack(isPresented: $isMaxWatchersSnackShown) { - SnackView(text: Res.strings().text_maximum_number_of_watchers.get()) + SnackView(text: String(\.text_maximum_number_of_watchers)) } .snack(isPresented: $isTooBigInputSnackShown) { - SnackView(text: Res.strings().text_too_big_input.get()) + SnackView(text: String(\.text_too_big_input)) } .sheet( isPresented: $baseBarInfo.isShown, diff --git a/ios/CCC/UI/Watchers/WatchersToolbarView.swift b/ios/CCC/UI/Watchers/WatchersToolbarView.swift index 95edbb6062..6de2f263a8 100644 --- a/ios/CCC/UI/Watchers/WatchersToolbarView.swift +++ b/ios/CCC/UI/Watchers/WatchersToolbarView.swift @@ -6,7 +6,6 @@ // Copyright © 2022 orgName. All rights reserved. // -import Res import SwiftUI struct WatchersToolbarView: View { @@ -18,22 +17,22 @@ struct WatchersToolbarView: View { HStack { ToolbarButton(clickEvent: backEvent, imgName: "chevron.left") - Text(Res.strings().txt_watchers.get()) + Text(String(\.txt_watchers)) .font(relative: .title3) Spacer() } - Text(Res.strings().txt_watchers_description.get()) + Text(String(\.txt_watchers_description)) .contentShape(Rectangle()) .font(relative: .caption) .multilineTextAlignment(.center) - .background(Res.colors().background_strong.get()) - .foregroundColor(Res.colors().text_weak.get()) + .background(\.background_strong) + .foregroundColor(\.text_weak) .padding(10.cp()) } .frame(width: .infinity, height: .nan) .padding(top: 15.cp(), leading: 10.cp(), trailing: 20.cp()) - .background(Res.colors().background_strong.get()) + .background(\.background_strong) } } diff --git a/ios/CCC/UI/Watchers/WatchersView.swift b/ios/CCC/UI/Watchers/WatchersView.swift index d7e84b9552..61bde8024e 100644 --- a/ios/CCC/UI/Watchers/WatchersView.swift +++ b/ios/CCC/UI/Watchers/WatchersView.swift @@ -7,7 +7,6 @@ // import Provider -import Res import SwiftUI struct WatchersView: View { @@ -22,7 +21,7 @@ struct WatchersView: View { var body: some View { ZStack { - Res.colors().background_strong.get().edgesIgnoringSafeArea(.all) + Color(\.background_strong).edgesIgnoringSafeArea(.all) VStack { WatchersToolbarView(backEvent: event.onBackClick) @@ -41,9 +40,9 @@ struct WatchersView: View { ) } .listRowInsets(.init()) - .listRowBackground(Res.colors().background.get()) - .background(Res.colors().background.get()) - }.withClearBackground(color: Res.colors().background.get()) + .listRowBackground(\.background) + .background(\.background) + }.withClearBackground(color: Color(\.background)) Spacer() @@ -54,24 +53,24 @@ struct WatchersView: View { Button { event.onAddClick() } label: { - Label(Res.strings().txt_add.get(), systemImage: "plus") + Label(String(\.txt_add), systemImage: "plus") .imageScale(.large) .frame(width: 108.cp(), height: 24.cp(), alignment: .center) .font(relative: .body) } - .foregroundColor(Res.colors().text.get()) + .foregroundColor(\.text) .padding(.vertical, 15.cp()) - .background(Res.colors().background_strong.get()) + .background(\.background_strong) Spacer() } } .frame(maxWidth: .infinity, alignment: .center) - .background(Res.colors().background_strong.get()) + .background(\.background_strong) default: VStack { - Text(Res.strings().txt_enable_notification_permission.get()) + Text(String(\.txt_enable_notification_permission)) .font(relative: .footnote) .multilineTextAlignment(.center) Button { @@ -81,25 +80,25 @@ struct WatchersView: View { UIApplication.shared.open(url) } } label: { - Label(Res.strings().txt_settings.get(), systemImage: "gear") + Label(String(\.txt_settings), systemImage: "gear") .imageScale(.large) .frame(width: 108.cp(), height: 32.cp(), alignment: .center) .font(relative: .body) } .padding(4.cp()) - .background(Res.colors().background_weak.get()) - .foregroundColor(Res.colors().text.get()) + .background(\.background_weak) + .foregroundColor(\.text) .cornerRadius(5.cp()) .padding(8.cp()) }.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) - .background(Res.colors().background.get()) + .background(\.background) } if state.isBannerAdVisible { AdaptiveBannerAdView(unitID: "BANNER_AD_UNIT_ID_WATCHERS").adapt() } } - .background(Res.colors().background_strong.get()) + .background(\.background_strong) } } } diff --git a/ios/CCC/Util/ConversionState.swift b/ios/CCC/Util/ConversionState.swift index 0d23ea8ef9..f79d4fd85c 100644 --- a/ios/CCC/Util/ConversionState.swift +++ b/ios/CCC/Util/ConversionState.swift @@ -7,24 +7,23 @@ // import Provider -import Res import SwiftUI extension ConversionState { func getText() -> String { switch self { case let onlineState as ConversionState.Online: - return Res.strings().text_online_last_updated.get(parameter: onlineState.lastUpdate ?? "") + return String(\.text_online_last_updated, parameter: onlineState.lastUpdate ?? "") case let cachedState as ConversionState.Cached: - return Res.strings().text_cached_last_updated.get(parameter: cachedState.lastUpdate ?? "") + return String(\.text_cached_last_updated, parameter: cachedState.lastUpdate ?? "") case let offlineState as ConversionState.Offline: if let date = offlineState.lastUpdate { - return Res.strings().text_offline_last_updated.get(parameter: date) + return String(\.text_offline_last_updated, parameter: date) } else { - return Res.strings().text_offline.get() + return String(\.text_offline) } case is ConversionState.Error: - return Res.strings().text_no_data.get() + return String(\.text_no_data) default: return "" } @@ -33,15 +32,15 @@ extension ConversionState { func getColor() -> Color { switch self { case is ConversionState.Online: - return Res.colors().success.get() + return Color(\.success) case is ConversionState.Cached: - return Res.colors().info.get() + return Color(\.info) case is ConversionState.Offline: - return Res.colors().warning.get() + return Color(\.warning) case is ConversionState.Error: - return Res.colors().error.get() + return Color(\.error) default: - return Res.colors().transparent.get() + return Color(\.transparent) } } } diff --git a/ios/CCC/Util/InterstitialAd.swift b/ios/CCC/Util/InterstitialAd.swift index a9d6607a45..babfa1c2a2 100644 --- a/ios/CCC/Util/InterstitialAd.swift +++ b/ios/CCC/Util/InterstitialAd.swift @@ -7,7 +7,6 @@ // import GoogleMobileAds -import Res final class InterstitialAd: NSObject, GADFullScreenContentDelegate { func show() { diff --git a/ios/CCC/Util/KermitExt.swift b/ios/CCC/Util/KermitExt.swift new file mode 100644 index 0000000000..61ac5ba959 --- /dev/null +++ b/ios/CCC/Util/KermitExt.swift @@ -0,0 +1,35 @@ +// +// KermitExt.swift +// CCC +// +// Created by Mustafa Ozhan on 26.09.23. +// Copyright © 2023 orgName. All rights reserved. +// + +import Provider + +extension KermitLogger { + func i(message: @escaping () -> String) { + self.i(throwable: nil, tag: "Kermit", message: message) + } + + func d(message: @escaping () -> String) { + self.d(throwable: nil, tag: "Kermit", message: message) + } + + func w(message: @escaping () -> String) { + self.w(throwable: nil, tag: "Kermit", message: message) + } + + func v(message: @escaping () -> String) { + self.v(throwable: nil, tag: "Kermit", message: message) + } + + func e(message: @escaping () -> String) { + self.e(throwable: nil, tag: "Kermit", message: message) + } + + func a(message: @escaping () -> String) { + self.a(throwable: nil, tag: "Kermit", message: message) + } +} diff --git a/ios/CCC/Util/ObservableSEEDViewModel.swift b/ios/CCC/Util/ObservableSEEDViewModel.swift index 466350def3..c2b43a6319 100644 --- a/ios/CCC/Util/ObservableSEEDViewModel.swift +++ b/ios/CCC/Util/ObservableSEEDViewModel.swift @@ -29,7 +29,8 @@ final class ObservableSEEDViewModel< init() { logger.d(message: { "ObservableSEED \(ViewModel.description()) init" }) - self.state = (viewModel.state?.value as? State) ?? State() + // swiftlint:disable:next force_cast + self.state = viewModel.state!.value as! State self.event = viewModel.event! } diff --git a/ios/CCC/Util/ResourceExt.swift b/ios/CCC/Util/ResourceExt.swift index acde1f7a84..d225d8254e 100644 --- a/ios/CCC/Util/ResourceExt.swift +++ b/ios/CCC/Util/ResourceExt.swift @@ -9,32 +9,64 @@ import Res import SwiftUI -extension ResourcesStringResource { - func get() -> String { - return Resources_iosKt.getString(stringResource: self).localized() +extension Image { + init(resourceKey: KeyPath) { + self.init(uiImage: Res.images()[keyPath: resourceKey].toUIImage()!) } - func get(parameter: Any) -> String { - return Resources_iosKt.getString(stringResource: self, parameter: parameter).localized() + + init(imageName: String) { + self.init(uiImage: ResourcesKt.getImageByName(name: imageName).toUIImage()!) } } -extension ResourcesColorResource { - func get() -> Color { - return Color(get()) +extension String { + init(_ resourceKey: KeyPath) { + self.init( + Resources_iosKt.getString( + stringResource: Res.strings()[keyPath: resourceKey] + ).localized() + ) } - func get() -> UIColor { - return Resources_iosKt.getColor(colorResource: self) + + init(_ resourceKey: KeyPath, parameter: Any) { + self.init( + Resources_iosKt.getString( + stringResource: Res.strings()[keyPath: resourceKey], parameter: parameter + ).localized() + ) } } -extension ResourcesImageResource { - func get() -> UIImage { - return self.toUIImage()! +extension Color { + init(_ resourceKey: KeyPath) { + self.init( + Resources_iosKt.getColor(colorResource: Res.colors()[keyPath: resourceKey]) + ) } } -extension String { - func getImage() -> UIImage { - return ResourcesKt.getImageByName(name: self).toUIImage()! +extension View { + public func foregroundColor( + _ resourceKey: KeyPath + ) -> some View { + return self.foregroundColor(Color(resourceKey)) + } + + public func accentColor( + _ resourceKey: KeyPath + ) -> some View { + return self.accentColor(Color(resourceKey)) + } + + public func background( + _ resourceKey: KeyPath + ) -> some View { + return self.background(Color(resourceKey)) + } + + public func listRowBackground( + _ resourceKey: KeyPath + ) -> some View { + return self.listRowBackground(Color(resourceKey)) } } diff --git a/ios/CCC/Util/RewardedAd.swift b/ios/CCC/Util/RewardedAd.swift index c5bf06e3ca..453b1021ba 100644 --- a/ios/CCC/Util/RewardedAd.swift +++ b/ios/CCC/Util/RewardedAd.swift @@ -7,7 +7,6 @@ // import GoogleMobileAds -import Res final class RewardedAd: NSObject, GADFullScreenContentDelegate { diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index e3d7c8bfcb..1951ea2bb2 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -8,16 +8,16 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.816.0) - aws-sdk-core (3.181.0) + aws-partitions (1.830.0) + aws-sdk-core (3.184.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-kms (1.72.0) + aws-sdk-core (~> 3, >= 3.184.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.134.0) + aws-sdk-s3 (1.136.0) aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) @@ -36,7 +36,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.102.0) + excon (0.104.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -66,7 +66,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.7) - fastlane (2.214.0) + fastlane (2.216.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -87,6 +87,7 @@ GEM google-apis-playcustomapp_v1 (~> 0.1) google-cloud-storage (~> 1.31) highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) @@ -98,17 +99,17 @@ GEM security (= 0.1.3) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.7.2) + fastlane-plugin-firebase_app_distribution (0.7.4) google-apis-firebaseappdistribution_v1 (~> 0.3.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.49.0) + google-apis-androidpublisher_v3 (0.50.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-core (0.11.1) addressable (~> 2.5, >= 2.5.1) @@ -141,10 +142,9 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.7.0) + googleauth (1.8.1) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) @@ -155,7 +155,6 @@ GEM jmespath (1.6.2) json (2.6.3) jwt (2.7.1) - memoist (0.16.2) mini_magick (4.12.0) mini_mime (1.1.5) multi_json (1.15.0) @@ -177,7 +176,7 @@ GEM ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.17.0) + signet (0.18.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -186,8 +185,8 @@ GEM CFPropertyList naturally terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) @@ -197,13 +196,13 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (1.8.0) + unicode-display_width (2.5.0) webrick (1.8.1) word_wrap (1.0.0) xcode-install (2.8.1) claide (>= 0.9.1) fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.22.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index ab70191c40..0000000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,21 +0,0 @@ -PODS: - - provider (0.0.3086) - - res (0.0.3086) - -DEPENDENCIES: - - provider (from `../ios/provider/provider.podspec`) - - res (from `../client/core/res/res.podspec`) - -EXTERNAL SOURCES: - provider: - :path: "../ios/provider/provider.podspec" - res: - :path: "../client/core/res/res.podspec" - -SPEC CHECKSUMS: - provider: 4b3bae2b51315a63ccf943420182b6d617d4a38e - res: b7e081a218a15086ab0ea72e0ac6235d109b71d6 - -PODFILE CHECKSUM: 412cec7fc739afa9e2c84446671ea1c95b0a4e74 - -COCOAPODS: 1.11.3 diff --git a/ios/podfile b/ios/podfile deleted file mode 100644 index 4f8854fc08..0000000000 --- a/ios/podfile +++ /dev/null @@ -1,12 +0,0 @@ -# Uncomment the next line to define a global platform for your project -platform :ios, '14.0' - -target 'CCC' do - # Comment the next line if you don't want to use dynamic frameworks - use_frameworks! - - # Pods for CCC - pod 'provider', :path => '../ios/provider/provider.podspec' - pod 'res', :path => '../client/core/res/res.podspec' - -end diff --git a/ios/provider/ios-provider.gradle.kts b/ios/provider/ios-provider.gradle.kts index df4a479c2e..5f7a213f97 100644 --- a/ios/provider/ios-provider.gradle.kts +++ b/ios/provider/ios-provider.gradle.kts @@ -1,30 +1,17 @@ -import org.jetbrains.kotlin.gradle.plugin.mpp.Framework -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget - plugins { - libs.plugins.apply { - id(multiplatform.get().pluginId) - id(cocoapods.get().pluginId) - } + id(libs.plugins.multiplatform.get().pluginId) } kotlin { @Suppress("OPT_IN_USAGE") targetHierarchy.default() - iosX64() - iosArm64() - iosSimulatorArm64() - - cocoapods { - ProjectSettings.apply { - summary = PROJECT_NAME - homepage = HOMEPAGE - ios.deploymentTarget = IOS_DEPLOYMENT_TARGET - version = getVersionName(project) - } - - framework { + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { + it.binaries.framework { baseName = Modules.IOS.provider.frameworkName isStatic = true @@ -47,12 +34,6 @@ kotlin { export(project(premium)) } } - - targets.withType { - binaries.withType { - linkerOpts.add("-lsqlite3") - } - } } @Suppress("UNUSED_VARIABLE") diff --git a/submodule/basemob b/submodule/basemob index d3089953a2..4a157379e1 160000 --- a/submodule/basemob +++ b/submodule/basemob @@ -1 +1 @@ -Subproject commit d3089953a229a8c076d79c6ba3e674190707c14e +Subproject commit 4a157379e15f499c62d472ec08d03228617e8927 diff --git a/submodule/logmob b/submodule/logmob index c0d35d7a96..8843847a31 160000 --- a/submodule/logmob +++ b/submodule/logmob @@ -1 +1 @@ -Subproject commit c0d35d7a96b6ec060885e1dd4ebb08eaedea75ec +Subproject commit 8843847a314678dca7f3aef6e0b36a0969086dd8 diff --git a/submodule/parsermob b/submodule/parsermob index bf803ce9e9..519c8fb5c7 160000 --- a/submodule/parsermob +++ b/submodule/parsermob @@ -1 +1 @@ -Subproject commit bf803ce9e9d43c31d26062781373a00014404878 +Subproject commit 519c8fb5c7139cb3c04c0d9e307aa5bb8d795805 diff --git a/submodule/scopemob b/submodule/scopemob index 80f3681729..86ff25a285 160000 --- a/submodule/scopemob +++ b/submodule/scopemob @@ -1 +1 @@ -Subproject commit 80f3681729b7ecfcb2dfbe8261da274967a31ec3 +Subproject commit 86ff25a28530724f71cbe352e05f7e3f1d841f15