作者:许更剑_725 | 来源:互联网 | 2023-05-17 12:46
Iwanttoimplementbacknavigation,usinglongpressandswipetotheleft,withoutliftingthefing
I want to implement back navigation, using longpress and swipe to the left, without lifting the finger, but the swipe gesture isn't recognised, if I don't lift the finger after the longpress.
我想实现后退导航,使用长按并向左滑动,而不抬起手指,但如果我在长按后不抬起手指,则无法识别滑动手势。
I also implemented the following delegate method, but the desired result isn't appearing. Any thoughts?
我还实现了以下委托方法,但没有出现所需的结果。有什么想法吗?
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if (gestureRecognizer == _longPress && otherGestureRecognizer == _swipe) {
return YES;
}
if (gestureRecognizer == _swipe && otherGestureRecognizer == _longPress) {
return YES;
}
return NO;
edit: - the longpress gesture fires method, which changes the background color of the current UIViewController (made it, just to see, if it fires). -the swipe gesture fires method, -popViewController:animated
编辑: - longpress手势触发方法,它改变当前UIViewController的背景颜色(制作它,只是为了看,如果它触发)。 - 滑动手势触发方法,-popViewController:动画
1 个解决方案