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

Broken navigation when sharing the TEX message #1146

Open
LukasKorba opened this issue Mar 21, 2024 · 0 comments
Open

Broken navigation when sharing the TEX message #1146

LukasKorba opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@LukasKorba
Copy link
Collaborator

LukasKorba commented Mar 21, 2024

The bug

When the share dialog is presented, the view underneath is dismissed.

Expected behaviour

System share dialog partially covers the view and let users to share the package and the view must stay visible the whole time. Once share is done or canceled, a user is still on the same view where the share was triggered.

Why?

It wasn't easy to find the root cause because there were too many variables that could play a role but in the end it's probably a bug in SwiftUI iOS 15. The following construct in SwiftUI

NavigationView {
    TabView(...) {
         ViewWhereShareHappens(...)
    }
}

doesn't work. The TabView nested inside NavigationView works fine for many other scenarios we needed until we hit the issue with system share dialog. SwiftUI for some reason triggers logic to dismiss the view.

Possible Solutions

Easiest one

Fix is a one liner in iOS 16. NavigationView is deprecated iOS 16+ and NavigationStack is the future, everything works fine with NavigationStack but it forces us to upgrade the deployment target.

NavigationStack {
    TabView(...) {
         ViewWhereShareHappens(...)
    }
}

Complex one

Staying on iOS 15 requires to swap the order of views, the TabView would be the parent and everything else must be done inside of it:

 TabView(...) {
     NavigationView {
         ViewWhereShareHappens(...)
    }
}

This fixes the problem but creates many more others. The navigation bar is no longer visible so title of the screen + settings buttons are no longer available. Any view presented in a navigation flow way is nested inside tab, so it requires us to do all such views modal ones. The transition animations would look different as well. It's a big change that basically changes the overall navigational pattern and behaviours that don't match Figma design.

@LukasKorba LukasKorba added bug Something isn't working Zashi 1.0 labels Mar 21, 2024
@LukasKorba LukasKorba modified the milestone: iOS Zashi 1.0 Mar 21, 2024
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

1 participant