Skip to content

Commit c0f7850

Browse files
Setup Koin for IOS;
1 parent 3ab5558 commit c0f7850

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.koin.core.context.startKoin
2+
3+
actual class KoinInitializer {
4+
5+
actual fun init() {
6+
startKoin {
7+
modules(applicationModule, viewModelModule)
8+
}
9+
}
10+
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
import androidx.compose.ui.window.ComposeUIViewController
2+
import platform.UIKit.UIViewController
23

3-
fun MainViewController() = ComposeUIViewController { App() }
4+
fun MainViewController(): UIViewController = ComposeUIViewController(
5+
configure = {
6+
KoinInitializer().init()
7+
}
8+
) {
9+
App()
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import org.koin.core.module.Module
2+
import org.koin.core.module.dsl.singleOf
3+
import org.koin.dsl.module
4+
5+
actual val viewModelModule: Module = module {
6+
singleOf(::ScreenAViewModel)
7+
}

0 commit comments

Comments
 (0)