Skip to content

Commit c33a3e0

Browse files
committed
SpotlessApply
1 parent a49cd54 commit c33a3e0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Fruitties/shared/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ kotlin {
5454
listOf(
5555
iosX64(),
5656
iosArm64(),
57-
iosSimulatorArm64()
57+
iosSimulatorArm64(),
5858
).forEach {
5959
it.binaries.framework {
6060
export(libs.androidx.lifecycle.viewmodel)

Fruitties/shared/src/iosMain/kotlin/com/example/fruitties/di/viewmodel/ViewModelStoreUtil.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ package com.example.fruitties.di.viewmodel
22

33
import androidx.lifecycle.ViewModel
44
import androidx.lifecycle.ViewModelProvider
5-
import androidx.lifecycle.ViewModelStore
65
import androidx.lifecycle.ViewModelStoreOwner
76
import androidx.lifecycle.viewmodel.CreationExtras
87
import kotlinx.cinterop.BetaInteropApi
98
import kotlinx.cinterop.ObjCClass
109
import kotlinx.cinterop.getOriginalKotlinClass
1110
import kotlin.reflect.KClass
1211

13-
1412
/**
1513
* This function allows retrieving any ViewModel from Swift Code with generics.
1614
* We only get [ObjCClass] type for the [modelClass], because the interop between Kotlin and Swift
@@ -30,4 +28,4 @@ fun ViewModelStoreOwner.viewModel(
3028
?: error("modelClass isn't a ViewModel type")
3129
val provider = ViewModelProvider.create(this, factory, extras ?: CreationExtras.Empty)
3230
return key?.let { provider[key, vmClass] } ?: provider[vmClass]
33-
}
31+
}

0 commit comments

Comments
 (0)