You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've adapted example app to handle deeplink, but app crashes when trying to get current coordinator:
finalclassAppCoordinator:NavigationCoordinatable{varstack:Stinsen.NavigationStack<AppCoordinator>@Rootvarunauthenticated= makeUnauthenticated
@Rootvarauthenticated= makeAuthenticated
init(){letuser=User() // obtaining user from persistent store
stack =NavigationStack(initial: \AppCoordinator.authenticated, user) // this is also handled by auth state listeners
}func makeUnauthenticated()->NavigationViewCoordinator<UnauthenticatedCoordinator>{NavigationViewCoordinator(UnauthenticatedCoordinator())}func makeAuthenticated(param user:User)->NavigationViewCoordinator<MainCoordinator>{NavigationViewCoordinator(MainCoordinator(user: user)) // MainCoordinator is a simple navigaion view coordinator
}func handleDynamicLink(_ url:URL){
guard let coordinator =self.hasRoot(\.authenticated)else{ // <-- Crashes here. self.isRoot(\.authenticated) causes the same crash
return}}}
Crash in NavigationCoordinatable.swift, line 661, col 21
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Printing description of route:
<ReferenceWritableKeyPath<AppCoordinator, Transition<AppCoordinator, RootSwitch, User, NavigationViewCoordinator>>: 0x280687280>
Printing description of inputItem: nil
App and coordination logic works perfectly, but this check on AppCoordinator level causes the crash.
It looks that unwraping
var root: NavigationRoot!
from NavigationStack (NavigationStack.swift, line 29) causes the crash. What is the reason for this crash and how to solve it?
Hi, any updates here? Maybe there are other ways to check if we're currently presenting this screen? Or mark some routes as exclusive (may be showed only once at a time)
Hi! I've adapted example app to handle deeplink, but app crashes when trying to get current coordinator:
Crash in NavigationCoordinatable.swift, line 661, col 21
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
Printing description of route:
<ReferenceWritableKeyPath<AppCoordinator, Transition<AppCoordinator, RootSwitch, User, NavigationViewCoordinator>>: 0x280687280>
Printing description of inputItem: nil
((input: App.User, comparator: ())?) inputItem = nil
Printing description of self:
<AppCoordinator: 0x283d59500>
App and coordination logic works perfectly, but this check on AppCoordinator level causes the crash.
It looks that unwraping
var root: NavigationRoot!
from NavigationStack (NavigationStack.swift, line 29) causes the crash. What is the reason for this crash and how to solve it?
Stinsen (2.0.7)
MacOS 12.6, XCode 14 Release, iOS 15-16
The text was updated successfully, but these errors were encountered: