Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call the view with a NavigationLink #73

Open
Sosotess93 opened this issue Jul 20, 2023 · 3 comments
Open

Cannot call the view with a NavigationLink #73

Sosotess93 opened this issue Jul 20, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Sosotess93
Copy link

Describe the bug
I use ShuffleStack, and I've managed to create exactly what I wanted with the library. The problem is that I can't call the view with the navigationLink.

I have an onboarding process, the first view contains the NavigationView and then each page is called in succession thanks to the navigation link, which is a button.

Here's the code that calls the view.

To Reproduce
Minimum amount of code to reproduce:

                        NavigationLink {
                            PlanShuffleStackView()
                                .navigationBarBackButtonHidden(true)
                        } label: {
                            Text("Suivant")
                                .font(.subheadline)
                                .foregroundColor(.white)
                                .fontWeight(.semibold)
                                .frame(width: 360, height: 44)
                                .background(
                                    LinearGradient(gradient: Gradient(colors: [.red, .blue]), startPoint: .topLeading, endPoint: .bottomTrailing)
                                )
                                .cornerRadius(10)
                        } //: NAVIGATION LINK
                        .padding(.vertical)

Expected behavior
Normally, the PlanShuffleStackView should open correctly.

Screenshots
I can't send any screenshots because the application freezes completely and nothing happens until the memory runs out.

Device information (please complete the following information):

  • Device: iPhone 14 pro max and Simulator
@Sosotess93 Sosotess93 added the bug Something isn't working label Jul 20, 2023
@Sosotess93
Copy link
Author

This is working like that

 Button {
                            route = .shuffleStack
                        } label: {
                            Text("Suivant")
                                .font(.subheadline)
                                .foregroundColor(.white)
                                .fontWeight(.semibold)
                                .frame(width: 360, height: 44)
                                .background(
                                    LinearGradient(gradient: Gradient(colors: [.red, .blue]), startPoint: .topLeading, endPoint: .bottomTrailing)
                                )
                                .cornerRadius(10)
                        } //: NAVIGATION LINK
                        .padding(.vertical)
                        .fullScreenCover(item: $route) { route in
                            switch route {
                            case .shuffleStack:
                                PlanShuffleStackView()
                            }
                        }

Could you check why this is not working with the Navigation Link ?

@dscyrescotti
Copy link
Owner

@Sosotess93 Great finding! Thank you for bringing up it. It seems something was broken with navigation link. :) Sure, I will take a look into it.

@dscyrescotti
Copy link
Owner

@Sosotess93 Since I couldn't reproduce your issue on device (iOS 16.5.1) as well as simulator (iOS 16.4), I wonder if it's happening on a specific iOS version. So could you please provide the version that you used when encountering the error? It would be super helpful to resolve this mystery. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants