SWRevealViewController and TableView - swipe to delete not working

前端 未结 2 1984
盖世英雄少女心
盖世英雄少女心 2021-01-15 15:43

I added the SWRevealViewController to my app, along with the hamburger stack to access my menu. My app has a UITableView for the main application view. I want to allow users

2条回答
  •  心在旅途
    2021-01-15 16:32

    Just found a solution after reading a thread of a guy asking a similar question to the maker of this class. Whatever class you use to add the gesture recognizers, make it the delegate of the SWRevealController then paste in this method.

    #pragma mark - SWRevealViewControllerDelegate
    
    - (BOOL)revealControllerPanGestureShouldBegin:(SWRevealViewController *)revealController
    {
        float velocity = [revealController.panGestureRecognizer velocityInView:self.view].x;
        if (velocity < 0 && self.revealViewController.frontViewPosition == FrontViewPositionLeft)
            return NO;
        else
            return YES;
    }
    

提交回复
热议问题