From 575098bc1b0064e6ef0a1d5cf0b5aba253e4e70d Mon Sep 17 00:00:00 2001 From: Konstantin Kolchurin Date: Fri, 26 Jul 2024 02:32:18 +0700 Subject: [PATCH] #51 moko-resources 0.24.1, annotated api, updated pod version --- .../dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt | 3 +++ gradle/libs.versions.toml | 2 +- sample/ios-app/Podfile.lock | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/errors/src/iosMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt b/errors/src/iosMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt index d4ff9fe..2366b14 100644 --- a/errors/src/iosMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt +++ b/errors/src/iosMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt @@ -8,6 +8,7 @@ import dev.icerock.moko.errors.ErrorEventListener import dev.icerock.moko.errors.presenters.ErrorPresenter import dev.icerock.moko.mvvm.dispatcher.EventsDispatcher import platform.UIKit.UIViewController +import kotlin.experimental.ExperimentalNativeApi import kotlin.native.ref.WeakReference actual interface ExceptionHandlerBinder { @@ -33,8 +34,10 @@ actual class ExceptionHandlerBinderImpl actual constructor( viewController: UIViewController, private val errorPresenter: ErrorPresenter ) : ErrorEventListener { + @OptIn(ExperimentalNativeApi::class) private val viewControllerRef = WeakReference(viewController) + @OptIn(ExperimentalNativeApi::class) override fun showError(throwable: Throwable, data: T) { val viewController = viewControllerRef.get() ?: return diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 55b4ed5..8e48434 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ androidLifecycleVersion = "2.2.0" androidCoreTestingVersion = "2.2.0" coroutinesVersion = "1.6.4" mokoMvvmVersion = "0.16.1" -mokoResourcesVersion = "0.24.0" +mokoResourcesVersion = "0.24.1" mokoErrorsVersion = "0.8.0" [libraries] diff --git a/sample/ios-app/Podfile.lock b/sample/ios-app/Podfile.lock index de80add..1768348 100644 --- a/sample/ios-app/Podfile.lock +++ b/sample/ios-app/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b -COCOAPODS: 1.11.3 +COCOAPODS: 1.15.2