Closed adelsaramii closed 10 months ago
Hi @adelsaramii Thanks for opening the issue. You will need to have an AppDelegate
defined like this. Let me know if that helps
Hi @adelsaramii Thanks for opening the issue. You will need to have an
AppDelegate
defined like this. Let me know if that helps
i did but in AppDelegate.swift the RouterContextKt is Unresolved reference. i did every step from your code also i did import shared module is this problem from your library? and aslo defaultComponentContext is Unresolved reference in shared -> ios. Please guide me
Hi @adelsaramii apologies for the late reply.
You'll need to add this file RouterContext.kt
in your shared module, under the iosMain source set
fun defaultRouterContext(): RouterContext = defaultRouterContext()
val Lifecycle.registry get() = this as LifecycleRegistry
fun Lifecycle.destroy() = registry.destroy()
fun Lifecycle.resume() = registry.resume()
fun Lifecycle.stop() = registry.stop()
With that, RouterContextKt
should no longer be an unresolved reference.
I think you raised a good issue here - it is not intuitive to set this up, and the documentation is unclear. I will use this issue to address this.
Same problem for me
import io.github.xxfast.decompose.router.defaultRouterContext
Unresolved reference
for iOS target
Hi @adelsaramii & @voitenkodev
I've added this section in the readme, that covers how to setup decompose-router on ios - and added code-examples for kotlin app delegates, and both swift-ui app and swift uikit app delegate.
The defaultRouterContext()
should now be available on the latest snapshot 0.5.1-SNAPSHOT
. Make sure to include the snapshot repository on your build if you wish to try out the snapshot builds - otherwise I will release stable 0.5.1 later today
Let me know how it goes
Addressed in 0.5.1
🎉
Thanks for fix
i saw your example about platform-configurations Ios but there is no sample and im lost i give you better look from my code and please guide me how to implement ios part
Class main.ios.kt
swift file ContentView.swift
swift file IOSApp