Skip to content

Commit

Permalink
命名优化
Browse files Browse the repository at this point in the history
  • Loading branch information
bo committed Aug 25, 2021
1 parent b93746a commit 8f45da3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion BOTransition/BOTransitionConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ FOUNDATION_EXTERN BOTransitionEffect const BOTransitionEffectFade;
附着在本config所属的vc上的手势转场,一个NSDictionary代表一个手势方向和对应的事件(比如弹出页面,或者弹出页面)
direction: UISwipeGestureRecognizerDirection(NSUInteger) //触发的方向
margin: @(YES/NO) nil=NO //是否必须在边缘开始, YES时会优先其他scrollView进行相应
allowBeganWithOtherSVBounces: @(YES/NO)
allowBeganWithSVBounces: @(YES/NO)
act: @(1/2) 1moveout(把当前vc关闭) 2movein(从当前vc弹出一个新vc)
*/
@property (nonatomic, readonly, nullable) NSMutableArray<NSDictionary *> *gesInfoAr;
Expand Down
2 changes: 1 addition & 1 deletion BOTransition/BOTransitionPanGesture.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef struct BOTransitionPanGestureBrief {
//BOTransitionGesDirection array
@property (nonatomic, readonly) NSSet<NSNumber *> *otherSVRespondedDirectionRecord;
@property (nonatomic, readonly) BOOL delayTrigger;
@property (nonatomic, readonly) BOOL beganWithOtherSVBounces;
@property (nonatomic, readonly) BOOL beganWithSVBounces;

@property (nonatomic, readonly) UIGestureRecognizerState transitionGesState;

Expand Down
8 changes: 4 additions & 4 deletions BOTransition/BOTransitionPanGesture.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ @interface BOTransitionPanGesture () <UIGestureRecognizerDelegate>
//保存正在响应手势的UIScrollView,对它们的状态进行检测来判断是否应该开始dismiss
@property (nonatomic, strong) NSMutableArray<UIScrollView *> *currPanScrollVAr;
@property (nonatomic, strong) NSMutableArray<NSValue *> *currPanScrollVSavOffsetAr;
@property (nonatomic, assign) BOOL beganWithOtherSVBounces;
@property (nonatomic, assign) BOOL beganWithSVBounces;

@property (nonatomic, assign) BOTransitionPanGestureBrief lastGesBrief;
@property (nonatomic, assign) BOOL needsRecoverWhenTouchDown;
Expand Down Expand Up @@ -147,7 +147,7 @@ - (void)innerReset {
//这个不用频繁释放了吧
// _otherGesWillExecSimultaneouslyStrategy = nil;

_beganWithOtherSVBounces = NO;
_beganWithSVBounces = NO;
[self clearCurrSVRecord];

if (_careOtherDic) {
Expand All @@ -174,7 +174,7 @@ - (void)makeGesStateCanceledButCanRetryBegan {
[_currPanScrollVSavOffsetAr removeAllObjects];
[_otherSVRespondedDirectionRecord removeAllObjects];
_delayTrigger = NO;
_beganWithOtherSVBounces = NO;
_beganWithSVBounces = NO;
}

- (BOOL)canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer {
Expand Down Expand Up @@ -271,7 +271,7 @@ - (void)touchesDidChange:(NSSet<UITouch *> *)touches
}];

if ([self currPanSVInBounces]) {
_beganWithOtherSVBounces = YES;
_beganWithSVBounces = YES;
}
} else {
return;
Expand Down
12 changes: 6 additions & 6 deletions BOTransition/BOTransitioning.m
Original file line number Diff line number Diff line change
Expand Up @@ -1321,10 +1321,10 @@ - (NSNumber *)boTransitionGesShouldAndWillBegin:(BOTransitionPanGesture *)ges
2 != otherSVResponseval.integerValue) {
//没有其他scrollview相应,或者响应到底或者bounces了,可以实施其他手势了

BOOL allowBeganWithOtherSVBounces = NO;
NSNumber *allowBeganWithOtherSVBouncesnum = [gesinfo objectForKey:@"allowBeganWithOtherSVBounces"];
if (nil != allowBeganWithOtherSVBouncesnum) {
allowBeganWithOtherSVBounces = allowBeganWithOtherSVBouncesnum.boolValue;
BOOL allowBeganWithSVBounces = NO;
NSNumber *allowBeganWithSVBouncesnum = [gesinfo objectForKey:@"allowBeganWithSVBounces"];
if (nil != allowBeganWithSVBouncesnum) {
allowBeganWithSVBounces = allowBeganWithSVBouncesnum.boolValue;
}

UISwipeGestureRecognizerDirection verd =\
Expand All @@ -1337,8 +1337,8 @@ - (NSNumber *)boTransitionGesShouldAndWillBegin:(BOTransitionPanGesture *)ges
方向相符
起始横竖和触发横竖相符
*/
if ((!ges.beganWithOtherSVBounces
|| allowBeganWithOtherSVBounces)
if ((!ges.beganWithSVBounces
|| allowBeganWithSVBounces)
&& (ges.triggerDirectionInfo.mainDirection & regdirection) > 0
&& initialisVertical == triggerisVertical) {

Expand Down

0 comments on commit 8f45da3

Please sign in to comment.