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
9 changes: 9 additions & 0 deletions TWTSideMenuViewController-Sample/TWTMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ - (void)viewDidLoad
self.navigationItem.leftBarButtonItem = openItem;

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kTableViewCellIdentifier];

UISwipeGestureRecognizer *swipeRightGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedRight:)];
swipeRightGesture.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRightGesture];
}

-(void)swipedRight:(UISwipeGestureRecognizer *)sender
{
[self openButtonPressed];
}

- (void)openButtonPressed
Expand Down
10 changes: 10 additions & 0 deletions TWTSideMenuViewController/TWTSideMenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ - (void)viewDidLoad
[self.menuViewController didMoveToParentViewController:self];

[self updateMenuViewWithTransform:[self closeTransformForMenuView]];

UISwipeGestureRecognizer *swipeLeftGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipedLeft:)];
swipeLeftGesture.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeLeftGesture];
}

-(void)swipedLeft:(UISwipeGestureRecognizer *)sender
{
if (self.open)
[self toggleMenuAnimated:YES completion: nil];
}

- (BOOL)shouldAutorotate
Expand Down