terryworona / TWMessageBarManager

An iOS manager for presenting system-wide notifications via a dropdown message bar.
MIT License
1.77k stars 191 forks source link

Support for single display mode #79

Closed Jpoliachik closed 9 years ago

Jpoliachik commented 9 years ago

While a message is displaying, this prevents additional messages from being added to the queue. Defaults to NO, which does not effect any outside behavior. Setting to YES makes the queue behavior irrelevant. However, I needed this feature in my project to prevent duplicate messages from being rapidly pushed onto the queue.

terryworona commented 9 years ago

Why not make this a simple @property?

I like the idea of protecting the queue with a mutex, but imo it doesn't belong in the library itself. It would make more sense for it to belong to the consumer using the library.

Meaning, create your own locks outside of the library, or wrap the manager in your own protection:

lock.down(TWMessageBarManager.sharedInstance())

lock.up(TWMessageBarManager.sharedInstance())

and:

if (!lock.isDown)
{
    TWMessageBarManager.showMessage....
}