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

One place to modifier toast #99

Open
tospery opened this issue Nov 8, 2024 · 2 comments
Open

One place to modifier toast #99

tospery opened this issue Nov 8, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@tospery
Copy link

tospery commented Nov 8, 2024

  1. ContentView is my first View. And, add the .toast modifier to it.
  2. ContentView present(fullScreenCover) the LoginView. And, the LoginView has its own NavigationStack.
  3. When i toggle the toast variable in LoginView. The ContentView will show the toast View. But, the toast View will behind the LoginView. Need close LoginView, you will see the toast.

How to solve this problem? My goal is to modifier toast in the first view so that toast will display normally whenever/anyplace it is triggered.

@tospery tospery added the good first issue Good for newcomers label Nov 8, 2024
@tospery
Copy link
Author

tospery commented Nov 8, 2024

I mean, how can I add the .toast to one place, anywhere in app can trigger it? Similarly, UIKit adds toast to the keyWindow

@tospery
Copy link
Author

tospery commented Nov 8, 2024

This is demo
https://github.com/tospery/AlertViewDemo

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

No branches or pull requests

1 participant