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
22 changes: 17 additions & 5 deletions Demo App/TableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,23 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[HHPanningTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];

UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];

drawerView.backgroundColor = [UIColor colorWithWhite:0.8f alpha:1.0f];

cell.drawerView = drawerView;
if (directionMask < 4) {
UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];

drawerView.backgroundColor = [UIColor colorWithWhite:0.8f alpha:1.0f];

cell.drawerView = drawerView;
} else {
// display a green drawer from the left, and a red drawer from the right

UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];
drawerView.backgroundColor = [UIColor greenColor];
cell.drawerLeftView = drawerView;

drawerView = [[UIView alloc] initWithFrame:cell.frame];
drawerView.backgroundColor = [UIColor redColor];
cell.drawerRightView = drawerView;
}
}

if (directionMask < 3) {
Expand Down
6 changes: 4 additions & 2 deletions HHPanningTableViewCell/HHPanningTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
typedef void (^HHDrawerRevealedCompletionBlock)(void);

typedef enum {
HHPanningTableViewCellDirectionRight = UISwipeGestureRecognizerDirectionRight,
HHPanningTableViewCellDirectionLeft = UISwipeGestureRecognizerDirectionLeft,
HHPanningTableViewCellDirectionRight = UISwipeGestureRecognizerDirectionRight,
HHPanningTableViewCellDirectionLeft = UISwipeGestureRecognizerDirectionLeft,
} HHPanningTableViewCellDirection;


Expand All @@ -48,6 +48,8 @@ typedef enum {
- (void)cleanup;

@property (nonatomic, strong) IBOutlet UIView* drawerView;
@property (nonatomic, strong) IBOutlet UIView* drawerLeftView;
@property (nonatomic, strong) IBOutlet UIView* drawerRightView;
@property (nonatomic, assign) CGFloat drawerOffset;

@property (nonatomic, assign) NSInteger directionMask;
Expand Down
Loading