SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 741 forks source link

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

Open AllLuckly opened 11 months ago

AllLuckly commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

wtmoose commented 11 months ago

Unlikely, but I’ll look at it

Coder-Miao commented 5 months ago

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 commented 5 months ago

I agree with Coder-Miao!

Jacky-LinPeng commented 3 weeks ago

I agree with Coder-Miao!

Jacky-LinPeng commented 3 weeks ago

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

已经实现优先级能力啦?开放出来共享不

Jacky-LinPeng commented 2 weeks ago

I agree with Coder-Miao!