<@UHAJKUSTU>, do you have a more detailed sample f...
# decompose
a
@Arkadii Ivanov, do you have a more detailed sample for iOS implementation? The full samples are useful but most of the parts I don’t really understand why they are there or whether theyre needed in my usecase. It would be great to have a move ios centric guide for decompose.
e
@Archie if you have any troubles with iOS configuration I will be happy to assist you. Please share you thoughts what is confusing you, let’s make iOS documentation better together
a
do you have a more detailed sample for iOS implementation
There are third-party samples as well, some of them are mentioned in the docs - https://arkivanov.github.io/Decompose/samples/ You can also check the Used by list for samples.
most of the parts I don’t really understand why they are there or whether theyre needed in my usecase
Perhaps, we could add some useful comments in the code.
It would be great to have a move ios centric guide for decompose.
It depends on what you are struggling with. Could you please elaborate and maybe link some parts that are not clear? My assumption was that there should be a general KMP background, in terms of how to connect a Kotlin library with an iOS project, how to wire the UI and Kotlin observable states, etc. There are plenty of articles on the Web. Decompose is based on top of that, but there are some minor differences as well (like how to switch views).
a
Like for example here at the Quick Start Docs. Android and Desktop have a snippets but all other platforms would refer to the samples. For first time users such as myself, it would be great to have a minimal snippet for other platforms as well without digging through the other samples. I find it harder to distinguish which in the samples are needed for a simple minimal setup for my trail/experiment project to work.
a
Thanks for the feedback! I agree, we could describe iOS integration in Quick Start docs. I have filed https://github.com/arkivanov/Decompose/issues/362
I find it harder to distinguish which in the samples are needed for a simple minimal setup for my trail/experiment project to work
For a minimal setup you can refer to the main Decompose sample - https://github.com/arkivanov/Decompose/tree/master/sample/app-ios
a
Thanks @Arkadii Ivanov. Is it required to export
Essenty
and
parcelize-darwin
with the iOS framework?
a
Essenty is required, because you need to drive the root lifecycle. Parcelize Darwin is optional, only if you really need state preservation on iOS. Either you use it in both the shared module and iOS app, or nowhere.
Parcelize Darwin is highly experimental
a
@Arkadii Ivanov Sorry I have alot of questions. Very new to Essenty, just wondering if
Essenty
StateKeeper is required for the iOS implementation? Is it okay to just pass nil for
Copy code
DefaultComponentContext(
   ...
   stateKeeper: nil,
   ...
)
a
No problem! If you don't use Parcelize Darwin, then there is no reason to use
StateKeeper
on iOS. Just pass
nil
. Please refer to the samples - app_iosApp.swift. Also,
DefaultComponentContext
has a separate constructor with only
Lifecycle
argument. It can be used in iOS.