Add the dependency in your common module's commonMain sourceSet
// Please do remember to add compose.foundation and compose.animation
api(compose.foundation)
api(compose.animation)
//...
api("moe.tlaster:precompose:$precompose_version")
// api("moe.tlaster:precompose-molecule:$precompose_version") // For Molecule intergration
// api("moe.tlaster:precompose-viewmodel:$precompose_version") // For ViewModel intergration
Change the Activity's parent class to moe.tlaster.precompose.lifecycle.PreComposeActivity
and use moe.tlaster.precompose.lifecycle.setContent
for setting compose content
Change the Window
to moe.tlaster.precompose.PreComposeWindow
Set the UIWindow.rootViewController
to PreComposeApplication
Change the Window
to moe.tlaster.precompose.PreComposeWindow
Change the Window
to moe.tlaster.precompose.preComposeWindow
That's it! Enjoying the PreCompose! Now you can write all your business logic and ui code in commonMain