MMDrawerController icon indicating copy to clipboard operation
MMDrawerController copied to clipboard

best way to delete table row under MMDrawerController

Open davidnomo opened this issue 9 years ago • 2 comments

Hi there,

I need to delete tablerow under MMDrawerController on ios swift. But swiper/gesture control goes to MMDrawerController. what is the best way to delete table row under the controller? Tried too disable MMDrawerController for given viewcontroller but it was not much fun. is there any one implement this functionality under MMDrawerController pls share. Thanks

davidnomo avatar Oct 14 '15 16:10 davidnomo

@davidnomo Something like that could work for you:

__typeof(self) __weak weakSelf = self;
[self.drawerController setGestureShouldRecognizeTouchBlock:
    ^BOOL(MMDrawerController *drawerController, UIGestureRecognizer *gesture, UITouch *touch) {
      CGPoint location = [touch locationInView:weakSelf.window];
      CGFloat width = CGRectGetWidth([UIScreen mainScreen].bounds);
      return 3.0f * location.x <= 2.0f * width;
    }];

ilidar avatar Dec 01 '15 21:12 ilidar

I solved the problem, for me the solution was the following: In the file MMDrawerController.m at the beginning of -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{

I added this code:

NSString *className = NSStringFromClass([touch.view class]);
if ([className isEqualToString:@"UITableViewCellContentView"]) {
    return NO;
}

mugx avatar Aug 09 '17 03:08 mugx