diff --git a/NoticeView/WBNoticeView/WBNoticeOperation.m b/NoticeView/WBNoticeView/WBNoticeOperation.m index ad6abca..4c62225 100644 --- a/NoticeView/WBNoticeView/WBNoticeOperation.m +++ b/NoticeView/WBNoticeView/WBNoticeOperation.m @@ -17,6 +17,9 @@ @interface WBNoticeOperation () @end @implementation WBNoticeOperation +@synthesize executing; +@synthesize cancelled; +@synthesize finished; - (void)start { diff --git a/NoticeView/WBNoticeView/WBNoticeView.h b/NoticeView/WBNoticeView/WBNoticeView.h index 8537b4f..be6d972 100644 --- a/NoticeView/WBNoticeView/WBNoticeView.h +++ b/NoticeView/WBNoticeView/WBNoticeView.h @@ -8,10 +8,10 @@ #import -typedef enum WBNoticeViewSlidingMode { +typedef NS_ENUM(NSUInteger, WBNoticeViewSlidingMode) { WBNoticeViewSlidingModeUp, WBNoticeViewSlidingModeDown, -} WBNoticeViewSlidingMode; +}; /** `WBNoticeView` objects provides a lightweight, non-intrusive means for displaying information to the user. The `WBNoticeView` class is an abstract class that encapsulates the interface common to all notice objects. diff --git a/NoticeView/WBNoticeView/WBNoticeView.m b/NoticeView/WBNoticeView/WBNoticeView.m index 2dec11d..e9ca98f 100644 --- a/NoticeView/WBNoticeView/WBNoticeView.m +++ b/NoticeView/WBNoticeView/WBNoticeView.m @@ -78,6 +78,10 @@ - (BOOL)isEqual:(WBNoticeView *)object return [self.title isEqual:object.title] && [self.message isEqual:object.message]; } +- (NSUInteger)hash { + return [self.title hash] + [self.message hash]; +} + #pragma mark - - (void)displayNotice @@ -120,10 +124,7 @@ - (void)displayNotice [self registerObserver]; } completion:^ (BOOL finished) { // if it's not sticky, hide it automatically - if ((self.tapToDismissEnabled && !self.isSticky) || (!self.tapToDismissEnabled && self.isSticky)) { - // Schedule a timer - self.displayTimer = [NSTimer scheduledTimerWithTimeInterval:self.delay target:self selector:@selector(dismissAfterTimerExpiration) userInfo:nil repeats:NO]; - } else if (!self.isSticky) { + if (!self.isSticky) { // Display for a while, then hide it again [self dismissNoticeWithDuration:self.duration delay:self.delay hiddenYOrigin:self.hiddenYOrigin]; }