A visual component to present a non-invasive notification to the user.
Based off of tciuro/NoticeView
If you're using CocoPods it's as simple as:
pod 'NoticeView', :git => 'https://github.com/levigroker/NoticeView.git'
+ (WBNoticeView *)noticeOfType:(WBNoticeType)noticeType
inView:(UIView *)view
title:(NSString *)title
message:(NSString *)message
duration:(NSTimeInterval)duration
dismissedBlock:(WBNoticeViewDismissedBlock)dismissedBlock;
WBNoticeTypeError
WBNoticeTypeSuccess
WBNoticeTypeSticky
Displays an "error" notification which will be displayed on the screen for
kErrorAlertNotificationDisplayTime
(a constant you define):
WBNoticeView *notice = [WBNoticeView noticeOfType:WBNoticeTypeError inView:self.view title:NSLocalizedString(@"That didn’t work.", nil) message:NSLocalizedString(@"Whatever you just did didn't work. Please try again.", nil) duration:kErrorAlertNotificationDisplayTime dismissedBlock:nil];
[notice show];
Displays a "success" notification for one and a half seconds, or is dismissed by the user, and provides a block to get executed when the notification is dismissed:
WBNoticeView *notice = [WBNoticeView noticeOfType:WBNoticeTypeSuccess inView:self.view title:@"7 New Tweets arrived somewhere from the intertubes." message:nil duration:1.5f dismissedBlock:^(BOOL userDismissed) {
NSLog(@"User did%@ dismiss the notification.", userDismissed ? @"" : @" not");
}];
[notice show];