I wondered if with Swift something like Kotlin Multiplatform is possible as well.
So that all the core logic would be written in Swift and for the UI I would use the native stack of the platform itself. Currently I'm not planning to build an app that requires a version for Apple, Android, Linux, Windows, and web. But I'm curious if someone has already some experience in creating a monorepo for all that platform that is scalable and maintainable. How much effort would this take to make that possible?
This is basically the approach that The Browser Company has taken and applied successfully for Arc and Dia. Both are extremely large projects and it has worked quite well.
I've been doing this for a while in a decently complex app, and I would say that the approach depends on several factors stemming from your app domain. To name a few:
What's your "core logic" made of? As in, is the app more UI or logic?
How does your data flow? Is it UI → Core (pull) or do you also need events/callback behavior like Core → UI (push)?
How asynchronous do you want it to be?
Is the Core platform-agnostic or very tied to the platform differences?
Do you have non-Swift dependencies?
Do you use SwiftPM or CMake?
I believe the answer to these questions could make the choice of sharing Swift logic a great bet or a lot of extra work. By that, I mean that in some cases, duplicating the native code could lead, paradoxically, to less maintenance than designing a shared core that fits heterogeneous platforms and programming languages.