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

Navigator fails to update view when a variable is passed via the screen #79

Open
KenLPham opened this issue Nov 29, 2021 · 1 comment
Open

Comments

@KenLPham
Copy link

KenLPham commented Nov 29, 2021

Bug description

Basically on startup the app will show AScreen with a variable value of nil to display a loading screen. The deeplinker will parse the link into the following path [AScreen(value: 20), BScreen()]. Since the deeplinker uses replace(path:) it will successfully replace AScreen but fails at presenting BScreen. Parsing the link so that the value of AScreen is nil will present BScreen fine. So it seems the issue is with the value changing.

Steps to reproduce

Example App

Using the code below seems to solve the issue

extension Screen {
    static func == (lhs: Self, rhs: Self) -> Bool {
        lhs.presentationStyle == rhs.presentationStyle && type(of: lhs) == type(of: rhs)
    }
}

public extension AnyScreen {
    static func == (lhs: Self, rhs: Self) -> Bool {
        lhs.screen == rhs.screen
    }
}

Expected behavior

App should navigate to BScreen even when the value in AScreen changes

Environment

  • Xcode 13
  • Swift 5.3
  • OS: iOS 15
  • Package v0.2.0

Additional context

Related: #74 (comment)

@KenLPham
Copy link
Author

After some more testing, modifying the equatable method will cause more issues (like with tab screens). This wouldn't be the best place to try and fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant