diff --git a/NoticeView/WBNoticeView/WBNoticeView.m b/NoticeView/WBNoticeView/WBNoticeView.m index 96ed294..2cb6336 100644 --- a/NoticeView/WBNoticeView/WBNoticeView.m +++ b/NoticeView/WBNoticeView/WBNoticeView.m @@ -117,12 +117,9 @@ - (void)displayNotice [self registerObserver]; } completion:^ (BOOL finished) { // if it's not sticky, hide it automatically - if ((self.tapToDismissEnabled && !self.isSticky) || (!self.tapToDismissEnabled && self.isSticky)) { + if (!self.isSticky) { // Schedule a timer self.displayTimer = [NSTimer scheduledTimerWithTimeInterval:self.delay target:self selector:@selector(dismissAfterTimerExpiration) userInfo:nil repeats:NO]; - } else if (!self.isSticky) { - // Display for a while, then hide it again - [self dismissNoticeWithDuration:self.duration delay:self.delay hiddenYOrigin:self.hiddenYOrigin]; } }]; } @@ -149,7 +146,7 @@ - (void)dismissNoticeWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval - (void)dismissNotice { [self.displayTimer invalidate]; - [self dismissNoticeWithDuration:self.duration delay:self.delay hiddenYOrigin:self.hiddenYOrigin]; + [self dismissNoticeWithDuration:self.duration delay:0.0 hiddenYOrigin:self.hiddenYOrigin]; } - (void)dismissNoticeInteractively