Comments (8)
Hi! I've checked this and it indeed seems like a bug. I'll investigate further...!
from stinsen.
@rundfunk47 I am still very curious about this one. I am actually trying to implement UNAuthorizationOptionProvidesAppNotificationSettings which provides a deeplink to in-app notification settings within my app. I get to this screen by focusing my profile tab, and then routing to settings (which pushes a new coordinator) and then calling a route(to: .notifications) on that coordinator. The chain looks like this (it begins with a notification center listener applied in my MainCoordinator (parent all of other coordinators)
.onReceive(NotificationCenter.default.publisher(for: .settingsRouteAction), perform: { _ in
self.focusFirst(\.profile)
.child
.popToRoot()
.route(to: \.settings)
.route(to: \.notifications)
})
The chain works as expected until the very end. It focuses the profile tab, pushes to settings, and then pushes to notifications. BUT the start
function gets called again after the push of notifications and it actually pops back to the settings view (before notifications). Any idea why?
I should note that this actually works if the notifications view is nested in its own NavigationViewCoordinator BUT that leads to a duplicative nav bar because its being pushed by the settings coordinator.
from stinsen.
Hi! I might be unsure what you mean, but the code you showed should work, provided that you have something like::
@Route(.push) var todoDetail = makeTodoDetail
in TodosCoordinator.swift
from stinsen.
Thanks for the fast reply. So a chain of two (push) routes should generally work?
I have been trying to do this in the stinsen/Examples/App code, by adding a todoDetail in HomeScreen
like this (the detail screen is just displaying some text for now):
Button(todo.name) {
authenticatedRouter
.focusFirst(\.todos)
.child
.popToRoot()
.route(to: \.todo, todo.id)
.route(to: \.detail, todo.id)
}
However, this only navigates the app to the Todos tab (and neither the todo screen nor the detail screen) and I don't get any errors in the console. If I only navigate to .todo
OR .detail
, the navigation works fine for each of the views, but never if I do both navigations.
from stinsen.
i'm interested in this question also
from stinsen.
I'd love to know if this is possible!
from stinsen.
@rundfunk47 Any update about this topic? We would like to use your library to support deep linking in our app, and chaining route(to:)
calls would be crucial for us. Looking forward to hearing from you and thank you for your great work!
from stinsen.
The chain navigation isn't possible. Is it a bug that can be fixed? Can we get an update on this?
from stinsen.
Related Issues (20)
- Can't I use onDismiss in route method? HOT 1
- Dismissing item issue HOT 2
- Exclude screens during deeplink HOT 1
- Issues caused by use of SwiftUI's NavigationStack HOT 2
- Can't get NavigationRouter via protocol
- Tabbar items customisation HOT 2
- dismissCoordinator animation
- dismissChild fatal optional
- How to correctly use focusFirst HOT 1
- Example just don't work
- Tabbar Item Accent Color Not working
- Presentation detents for sheets
- Memory leaks in iOS17 HOT 8
- How do I know which route I am in?
- Custom back button modifier HOT 1
- Poplast didn't work as expected
- Pops back when updating @ObservableObject
- How to add a badge in TabBar HOT 1
- TabCoordinatable does not deinit when parent coordinator changes its root HOT 1
- RouterStore singleton Swift 6 warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stinsen.