Coder Social home page Coder Social logo

Comments (8)

rundfunk47 avatar rundfunk47 commented on August 25, 2024 7

Hi! I've checked this and it indeed seems like a bug. I'll investigate further...!

from stinsen.

sbilling avatar sbilling commented on August 25, 2024 1

@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.

rundfunk47 avatar rundfunk47 commented on August 25, 2024

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.

schrulnz avatar schrulnz commented on August 25, 2024

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.

MartinaRogach avatar MartinaRogach commented on August 25, 2024

i'm interested in this question also

from stinsen.

abrown252 avatar abrown252 commented on August 25, 2024

I'd love to know if this is possible!

from stinsen.

PeterKovacs89 avatar PeterKovacs89 commented on August 25, 2024

@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.

nunocaseiro avatar nunocaseiro commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.