You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I specify my ViewModel modules differently on iOS and Android. On Android, I want the viewModel<> specifier. However, on iOS (I am using SwiftUI) I want this to be a normal factory<> specifier.
Describe the solution you'd like
I'd like to be able to make the @ViewModel annotation fall back to @Factory on platforms that doesn't support viewModel natively.
BaseViewModel.kt
expectabstractclassBaseViewModel()
BaseViewModel.ios.kt
actualabstractclassBaseViewModel()
BaseViewModel.ios.kt
importandroidx.lifecycle.ViewModelactualabstractclassBaseViewModel actual constructor(): ViewModel()
MyViewModel.kt
@FactoryViewModel
class MyViewModel: BaseViewModel()
@Module
@ComponentScan
classMyModule
Describe alternatives you've considered
I can do this with an expect/actual module with pure Koin.
Is your feature request related to a problem? Please describe.
I specify my ViewModel modules differently on iOS and Android. On Android, I want the
viewModel<>
specifier. However, on iOS (I am using SwiftUI) I want this to be a normalfactory<>
specifier.Describe the solution you'd like
I'd like to be able to make the
@ViewModel
annotation fall back to@Factory
on platforms that doesn't supportviewModel
natively.BaseViewModel.kt
BaseViewModel.ios.kt
BaseViewModel.ios.kt
MyViewModel.kt
Describe alternatives you've considered
I can do this with an
expect
/actual
module with pure Koin.ViewModelModule.ios.kt
ViewModelModule.android.kt
Target Koin project
koin-annotations
The text was updated successfully, but these errors were encountered: