-
Notifications
You must be signed in to change notification settings - Fork 1
/
LGSwipeableTableViewCell.h
executable file
·61 lines (46 loc) · 1.78 KB
/
LGSwipeableTableViewCell.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
//
// LGSwipeableTableViewCell.h
//
//
// Created by Lionel GUEGANTON on 8/07/14.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, LGSwipeDirection) {
LGSwipeDirectionNone,
LGSwipeDirectionLeft,
LGSwipeDirectionRight
};
@class LGSwipeableTableViewCell;
@protocol LGSwipeableTableViewCellDelegate <NSObject>
-(void) swipeableTableViewCellDidBeginDragging:(LGSwipeableTableViewCell*)swipeableCell;
@optional
-(void) swipeableTableViewCell:(LGSwipeableTableViewCell*)swipeableCell isSwipingToOffset:(NSInteger)swipeOffset;
-(void) swipeableTableViewCellDidExpand:(LGSwipeableTableViewCell*)swipeableCell;
-(void) swipeableTableViewCellDidCollapse:(LGSwipeableTableViewCell*)swipeableCell;
@end
/**
+-------------+
|
| |
+-------------+
*/
@interface LGSwipeableTableViewCell : UITableViewCell <UIScrollViewDelegate> {
IBOutlet UIView* _rightSwipeActionView;
IBOutlet UIView* _leftSwipeActionsView;
IBOutlet UIView* _swipeableContentView;
UIScrollView* _scrollView;
CGPoint _offsetLeftSwiped;
CGPoint _offsetRightSwiped;
CGPoint _offsetIdle;
LGSwipeDirection _state;
/** If at the end of the drag, the velocity is not fast enough, setting this flag to
`YES` will trigger an animation to make the scrollView go until the proper content offset. */
BOOL _shouldFinishDragProperly;
id<LGSwipeableTableViewCellDelegate> _swipeDelegate;
}
@property (readwrite) LGSwipeDirection state;
@property (readwrite, retain) UIView* rightSwipeActionView;
@property (readwrite, retain) UIView* leftSwipeActionsView;
@property (readwrite, retain) UIView* swipeableContentView;
@property (readwrite, assign) id<LGSwipeableTableViewCellDelegate> swipeDelegate;
@end