forked from KOed/welly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
WLPopUpMessage.m
41 lines (35 loc) · 1022 Bytes
/
WLPopUpMessage.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// LLPopUpMessage.m
// Welly
//
// Created by gtCarrera @ 9# on 08-9-11.
// Copyright 2008. All rights reserved.
//
#import "WLPopUpMessage.h"
#import "WLEffectView.h"
@implementation WLPopUpMessage
WLEffectView *_effectView;
NSTimer *_prevTimer;
#pragma mark Class methods
+ (void)hidePopUpMessage {
if (_effectView) {
[_effectView removePopUpMessage];
[_effectView release];
}
_prevTimer = nil;
}
+ (void)showPopUpMessage:(NSString*)message
duration:(CGFloat)duration
effectView:(WLEffectView *)effectView {
if (_prevTimer) {
[_prevTimer invalidate];
}
[effectView drawPopUpMessage:message];
_effectView = [effectView retain];
_prevTimer = [NSTimer scheduledTimerWithTimeInterval:duration
target:self
selector:@selector(hidePopUpMessage)
userInfo:nil
repeats:NO];
}
@end