1/ 在view加载的时候
//添加向右滑动手势
UISwipeGestureRecognizer *swipeGes=[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction:)];
swipeGes.direction=UISwipeGestureRecognizerDirectionRight;
swipeGes.numberOfTouchesRequired=1;
swipeGes.delegate=self;
[self.view addGestureRecognizer:swipeGes];
2 实现方法
/**
* 向右滑动划出侧边栏
*/
-(void)swipeAction:(UISwipeGestureRecognizer *)sender
{
//AddBy–肖小丰(触发边界)
CGPoint point = [sender locationInView:self.view];
if (point.x > 20.0 && self.isShowLeftMeum) {
SUNViewController drawerController = (SUNViewController )self.navigationController.mm_drawerController;
[drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
}
}