Pick the fix
A team is starting a Kotlin Multiplatform app sharing ViewModels and repositories with iOS. Which DI choice fits shared code?
Hint 1 of 1
Which frameworks run on iOS?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Koin or manual DI in the shared module
Correct. Hilt only runs on Android, so it can't wire shared code for iOS.
Why not the others?
- B Hilt in the shared module. Hilt depends on Android and Dagger code generation for the JVM.
- C No DI; create everything with constructors inside classes. Hard to test, and lifetimes become ad hoc.
- D Dagger 1. Long obsolete.