terryworona / TWMessageBarManager

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

Bugfix: Messages created from a message callback won't appear #86

Closed sascha-wolf closed 8 years ago

sascha-wolf commented 8 years ago

This happened due to the fact that selecting a message will set the "messageVisible" boolean property to NO before calling the callback. When a new message get's presented, this message will be instantly shown, due to the "messageVisible" property being NO. If no further message is queued, the messageWindow will be set to nil and the callback message never shows up.

This can be fixed by setting "messageVisible" to NO after calling the callback, to avoid that the message will be shown instantly and instead remains in the queue.

sascha-wolf commented 8 years ago

The behavior can be replicated with this small code snippet:

[[TWMessageBarManager sharedInstance] showMessageWithTitle:@"Test" description:@"Test" type:TWMessageBarMessageTypeInfo callback:^{
    [[TWMessageBarManager sharedInstance] showMessageWithTitle:@"Inner Test" description:@"Inner Test" type:TWMessageBarMessageTypeError];
}];

When selecting the first message, the inner message will never appear.