Closed shubhamgupta-mob-ibtech closed 8 years ago
don not use UIPanGestureRecognizer in the uiviewcontroller when you want to use tableview swipe to delete
but I think the direction is on the contrary, UIPanGestureRecognizer is from left to rught(default) while swipe to delete is from right to left
------------------ 原始邮件 ------------------ 发件人: "shubhamgupta-mob-ibtech";notifications@github.com; 发送时间: 2015年5月26日(星期二) 下午2:52 收件人: "romaonthego/REFrostedViewController"REFrostedViewController@noreply.github.com;
主题: [REFrostedViewController] Gestures Conflict on UITableView swipe todelete (#137)
Hi, Currently i am stuck in problem conflict between UIPanGestureRecognizer and tableview swipe to delete.
Can anyone please help me out from this.
Thanks!
— Reply to this email directly or view it on GitHub.
UIPanGestureRecognizer is using in REFrostedViewController. When i add frostViewController the pan gesture is automatically added to the view controller.
you can abandon the gesture by deleting“ - (void)panGestureRecognized:(UIPanGestureRecognizer *)sender " in DEMONavigationController.m and add it in REFrostedViewController.m when you need to use the gesture
------------------ 原始邮件 ------------------ 发件人: "shubhamgupta-mob-ibtech";notifications@github.com; 发送时间: 2015年5月26日(星期二) 下午3:12 收件人: "romaonthego/REFrostedViewController"REFrostedViewController@noreply.github.com; 抄送: "Monkey S."4919668@qq.com; 主题: Re: [REFrostedViewController] Gestures Conflict on UITableView swipeto delete (#137)
UIPanGestureRecognizer is using in REFrostedViewController. When i add frostViewController the pan gesture is automatically added to the view controller.
— Reply to this email directly or view it on GitHub.
I had this issue as well. But I have a very simple implementation for this issue. The logic used by me in DemoNavigationController:
Instead of: [self.view addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]];
Use: UIView *vw_pan = [[UIView alloc] initWithFrame:CGRectMake(0, self.navigationBar.frame.size.height + [UIApplication sharedApplication].statusBarFrame.size.height, 40, self.view.frame.size.height)]; vw_pan.backgroundColor = [UIColor clearColor]; [self.view addSubview:vw_pan]; [vw_pan addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]];
This means decrease the pangesture from full screen to a limited area in the left edge of the screen. Hope it helps.
@CianApple's Swift 4.1 version would look like below:
let vwPan = UIView.init(frame: CGRect(x: 0, y: self.navigationBar.frame.size.height + UIApplication.shared.statusBarFrame.size.height, width: 40, height: self.view.frame.size.height))
vwPan.backgroundColor = UIColor.clear
self.view.addSubview(vwPan)
vwPan.addGestureRecognizer(UIPanGestureRecognizer.init(target: self, action: #selector(panGestureRecognizer)))
Hi, Currently i am stuck in problem conflict between UIPanGestureRecognizer and tableview swipe to delete.
Can anyone please help me out from this.
Thanks!