forkingdog / FDFullscreenPopGesture

A UINavigationController's category to enable fullscreen pop gesture with iOS7+ system style.
MIT License
5.9k stars 1.15k forks source link

9.0之后出现的bug #128

Closed HatsuneMikuV closed 7 years ago

HatsuneMikuV commented 7 years ago

手机系统是8.4 使用了FDFullscreenPopGesture 然后从A push到B 使用手势滑动返回,出现了崩溃的BUG 提示 跟

@property(nonatomic, copy) NSArray<NSNumber > allowedTouchTypes NS_AVAILABLE_IOS(9_0); // Array of UITouchTypes as NSNumbers. @property(nonatomic, copy) NSArray<NSNumber > allowedPressTypes NS_AVAILABLE_IOS(9_0); // Array of UIPressTypes as NSNumbers.

这个两个属性有关

HatsuneMikuV commented 7 years ago

我重写了代理的方法

如下 是不是有问题?

pragma mark -

pragma mark ==============手势拦截==============

HatsuneMikuV commented 7 years ago

找到方法了 不需要重写

修改了你们的库

添加属性 /// Max not allowed initial distance to top edge when you begin the interactive pop /// gesture. 0 by default, which means it will ignore this limit. @property (nonatomic, assign) CGFloat fd_interactivePopMaxAllowedInitialDistanceToHeightEdge;

在使用的时候 添加判断

CGPoint beginningLocation = [gestureRecognizer locationInView:gestureRecognizer.view];

// Ignore when the beginning location is beyond max allowed initial distance to left edge. CGFloat maxAllowedInitialDistance = topViewController.fd_interactivePopMaxAllowedInitialDistanceToLeftEdge; if (maxAllowedInitialDistance > 0 && beginningLocation.x > maxAllowedInitialDistance) { return NO; } // Ignore when the beginning location is beyond max not allowed initial distance to top edge. CGFloat maxAllowedInitialHeightDistance = topViewController.fd_interactivePopMaxAllowedInitialDistanceToHeightEdge; if (maxAllowedInitialHeightDistance > 0 && beginningLocation.y < maxAllowedInitialHeightDistance) { return NO; }

HatsuneMikuV commented 7 years ago

希望大佬们有空能完善一下,丰富用法

HatsuneMikuV commented 7 years ago

@sunnyxx 希望能丰富一下,增加高度判断滑动区域,因为跟视频相关的界面,视频是不能被侧滑的

afantree commented 7 years ago

@HatsuneMikuV 这个是禁止侧滑的,在跟视频相关的界面这么操作是不是可以? To disable this pop gesture of a view controller: viewController.fd_interactivePopDisabled = YES;

HatsuneMikuV commented 7 years ago

@afantree viewController.fd_interactivePopDisabled = YES; 这样禁止了全部不能侧滑 而现在好多视频APP基本是视频部分不能侧滑,而视频下面的内容部分是可以侧滑的 例如acfun