[iOS] TSMessages v0.9.3 Added dismissActiveNotification Method to Hide Currently Active View
In iOS app development, the TSMessages library, which allows easy implementation of notification views, added a dismissActiveNotification method in version 0.9.3 to hide the currently displayed view.
・toursprung/TSMessages - Changes
/** Fades out the currently displayed notification. If another notification is in the queue,
the next one will be displayed automatically
@return YES if the currently displayed notification could be hidden. NO if no notification
was currently displayed.
*/
+ (BOOL)dismissActiveNotification
{
if ([[TSMessage sharedMessage].messages count] == 0) return NO;
dispatch_async(dispatch_get_main_queue(), ^
{
TSMessageView *currentMessage = [[TSMessage sharedMessage].messages objectAtIndex:0];
if (currentMessage.messageIsFullyDisplayed)
{
[[TSMessage sharedMessage] fadeOutNotification:currentMessage];
}
});
return YES;
}
Previously, there was no way to call a method to hide the notification view from external code, so I had to fork TSMessages and make it callable from outside.
Since the dismissActiveNotification method has been added, I’ll use this instead.
That’s all from the Gemba.