File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
src/iosMain/kotlin/com/example/fruitties/di/viewmodel Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ kotlin {
54
54
listOf (
55
55
iosX64(),
56
56
iosArm64(),
57
- iosSimulatorArm64()
57
+ iosSimulatorArm64(),
58
58
).forEach {
59
59
it.binaries.framework {
60
60
export(libs.androidx.lifecycle.viewmodel)
Original file line number Diff line number Diff line change @@ -2,15 +2,13 @@ package com.example.fruitties.di.viewmodel
2
2
3
3
import androidx.lifecycle.ViewModel
4
4
import androidx.lifecycle.ViewModelProvider
5
- import androidx.lifecycle.ViewModelStore
6
5
import androidx.lifecycle.ViewModelStoreOwner
7
6
import androidx.lifecycle.viewmodel.CreationExtras
8
7
import kotlinx.cinterop.BetaInteropApi
9
8
import kotlinx.cinterop.ObjCClass
10
9
import kotlinx.cinterop.getOriginalKotlinClass
11
10
import kotlin.reflect.KClass
12
11
13
-
14
12
/* *
15
13
* This function allows retrieving any ViewModel from Swift Code with generics.
16
14
* We only get [ObjCClass] type for the [modelClass], because the interop between Kotlin and Swift
@@ -30,4 +28,4 @@ fun ViewModelStoreOwner.viewModel(
30
28
? : error(" modelClass isn't a ViewModel type" )
31
29
val provider = ViewModelProvider .create(this , factory, extras ? : CreationExtras .Empty )
32
30
return key?.let { provider[key, vmClass] } ? : provider[vmClass]
33
- }
31
+ }
You can’t perform that action at this time.
0 commit comments