SwiftMessages icon indicating copy to clipboard operation
SwiftMessages copied to clipboard

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

Open AllLuckly opened this issue 2 years ago • 8 comments

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.

AllLuckly avatar Jul 18 '23 09:07 AllLuckly

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.

wtmoose avatar Jul 19 '23 14:07 wtmoose

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

AllLuckly avatar Jul 22 '23 01:07 AllLuckly

Unlikely, but I’ll look at it

wtmoose avatar Jul 22 '23 01:07 wtmoose

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.

Coder-Miao avatar Jan 24 '24 08:01 Coder-Miao

I agree with Coder-Miao!

liyunxin avatar Jan 24 '24 08:01 liyunxin

I agree with Coder-Miao!

Jacky-LinPeng avatar Jun 14 '24 03:06 Jacky-LinPeng

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

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

Jacky-LinPeng avatar Jun 14 '24 03:06 Jacky-LinPeng

I agree with Coder-Miao!

Jacky-LinPeng avatar Jun 14 '24 06:06 Jacky-LinPeng