-
Notifications
You must be signed in to change notification settings - Fork 39
/
WipeView.h
61 lines (48 loc) · 1.13 KB
/
WipeView.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// WipeView.h
// WipeView
//
// Created by Tyler Neylon on 3/30/11.
//
// An image view that can animate out via a wipe.
// For example, a left-to-right wipe out animation
// (corresponding to direction (-1,0) = left), would
// look like this over time:
//
// 1. /----\
// |----|
// \----/
// 2. ---\
// ---|
// ---/
// 3. -\
// -|
// -/
// 4.
//
//
// Things are much more efficient without transparency,
// so the current code does not support any transparency
// along the disappearing edge -- it's a hard cut-off.
//
// You can leave the delegate as nil if you don't care
// about when the animation finishes.
//
#import <Foundation/Foundation.h>
@protocol WipeViewDelegate
- (void)wipeDidStop;
@end
@interface WipeView : UIView {
@private
// strong
UIImage *image;
// weak
UIView *contentView;
id<WipeViewDelegate> delegate;
NSTimeInterval duration;
}
@property (nonatomic, retain) UIImage *image;
@property (nonatomic, assign) id<WipeViewDelegate> delegate;
@property (nonatomic) NSTimeInterval duration;
- (void)wipeOutInDirection:(CGPoint)direction;
@end