Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NoticeView/WBNoticeView/WBNoticeOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ @interface WBNoticeOperation ()
@end

@implementation WBNoticeOperation
@synthesize executing;
@synthesize cancelled;
@synthesize finished;

- (void)start
{
Expand Down
4 changes: 2 additions & 2 deletions NoticeView/WBNoticeView/WBNoticeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#import <Foundation/Foundation.h>

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.
Expand Down
9 changes: 5 additions & 4 deletions NoticeView/WBNoticeView/WBNoticeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];
}
Expand Down