Hello, Is there an official documentation with a ...
# multiplatform
t
Hello, Is there an official documentation with a suggested architecture for KMP apps/libraries? I am currently trying to create a library. The documentation I use for reference is the one provided by the Android. This currently what I am doing
Copy code
my-project/
├─ shared/
│  ├─ feature.domain.usecase/
│  │  ├─ GetSomethingUseCase
├─ android/
│  ├─ feature.domain.usecase/
│  │  ├─ GetSomethingUseCaseImpl
├─ iOS/
│  ├─ feature.domain.usecase/
│  │  ├─ GetSomethingUseCaseImpl
Where
GetSomethingUseCase
Copy code
interface GetSomethingUseCase {
    operator fun invoke(): String
}
And Android
GetSomethingUseCaseImpl
Copy code
class GetSomethingUseCaseImpl(private val context: Context) : GetSomethingUseCase {
    override operator fun invoke() = TODO("It uses the context.")
}
And iOS
GetSomethingUseCaseImpl
Copy code
class GetSomethingUseCaseImpl(private val context: NSBundle) : GetSomethingUseCase {
    override operator fun invoke() = TODO("It does use something else.")
}
I am not sure I am doing it the correct way. Without expect/actual, I am loosing some tips, like “missing implementation” errors at compile time 😞
c
not sure if I got your point. but if you’re adding it to your Koin file it should be available on the apps side
t
Thanks for your time. Sorry for the confusion 😅 Just wanted to know if had app/library architecture example. PeopleInSpace is a great example for the configuration, but the project is rather simple (not so much use of native apis).