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

Can you add a function to display priority based on weight? #523

Open
AllLuckly opened this issue Jul 18, 2023 · 5 comments
Open

Can you add a function to display priority based on weight? #523

AllLuckly opened this issue Jul 18, 2023 · 5 comments

Comments

@AllLuckly
Copy link

Can you add a function to display priority based on weight? For example, what I am showing now is a pop-up window with low priority. When another pop-up window with high priority arrives, if the user does not perform any operation, we will automatically hide the pop-up window with low weight, and then display the pop-up window with high priority. window, when the user finishes operating the high-priority pop-up window, the low-priority pop-up window will pop up.

@wtmoose
Copy link
Member

wtmoose commented Jul 19, 2023

I don't see this feature having broad appeal and I unfortunately don't have time to do custom work for individual projects.

Here's my suggestion:

  1. Have two SwiftMessages instances, one for low priority messages and another for high priority messages.
  2. Present messages at varying window levels, e.g. low priority messages at .normal level and high priority at .alert level, using the presentationContext = .window(...) config setting.

High priority messages will cover lower priority messages. When the higher priority message is hidden, any remaining lower priority messages will be revealed.

@AllLuckly
Copy link
Author

Thank you for your reply, I have already written the relevant functions, are you willing to accept my pull requests?

@wtmoose
Copy link
Member

wtmoose commented Jul 22, 2023

Unlikely, but I’ll look at it

@Coder-Miao
Copy link

I think most scenarios need to set the priority of the box, which is throughout the entire app life cycle. I think future versions can add this configuration, which will gain more recognition and love from developers.

@liyunxin
Copy link

I agree with Coder-Miao!

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

4 participants