FullscreenPopGestureRecognizer.h
3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//
// FullscreenPopGestureRecognizer.h
// BBAPods
//
// Created by qfu on 3/30/16.
// Copyright © 2016 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FullscreenPopGestureRecognizer : NSObject
/**
全屏手势
*/
@property (nullable, nonatomic,weak) UIPanGestureRecognizer *popRecognizer;
/**
边缘手势
*/
@property (nullable, nonatomic,weak) UIScreenEdgePanGestureRecognizer *edgePopRecognizer;
/**
全屏手势开关
*/
@property (nonatomic,assign) BOOL enabled;
/**
是否已经处于手势过程中(手势)
*/
@property (nonatomic,assign) BOOL popActionDidStart;
/**
是否已经处于手势过程中(手势+动画)
*/
@property (nonatomic,assign) BOOL isTransiting;
/**
全屏手势响应默认值
*/
@property (nonatomic,assign) BOOL defaultFullGesterShouldRecognizer;
/**
全屏手势初始化
*/
- (nullable instancetype)initWithNavigationController:(nonnull UINavigationController *)controller;
/**
用于手势期间获取栈内元素
*/
- (nullable UIViewController *)bbaAnimationTopViewController;
/**
用于手势期间获取栈内元素
*/
- (nullable UIViewController *)bbaTopViewController;
/**
* @brief 处于手势过程中(手势+动画)topVC
*
* @return vc
*/
- (nullable UIViewController *)bbaTransitingTopViewController;
/**
用于手势期间获取栈内元素
*/
- (nullable NSArray<__kindof UIViewController *> *)bbaViewControllers;
@end
#pragma mark - 针对VC的控制
@protocol BBAFullscreenPopGestureProtocol<NSObject>
@optional
/**
支持全屏返回手势
*/
- (BOOL)supportFullscreenPopGesture;
/**
支持边缘返回手势
*/
- (BOOL)supportEdgePopGesture;
/**
边缘侧滑返回手势是否被禁用(废弃)
*/
- (BOOL)disablePopGesture NS_DEPRECATED_IOS(1_0, 1_0, "10.3已废弃, 请使用supportEdgePopGesture");
/**
全屏返回手势支持同时响应
*/
- (BOOL)fullscreenPopGestureShouldRecognizeSimultaneously;
/**
边缘返回手势支持同时响应
*/
- (BOOL)edgePopGestureShouldRecognizeSimultaneously;
/**
接收到touch事件时是否响应全屏手势
*/
- (BOOL)fullscreenPopGestureShouldReceiveTouch:(nullable UITouch *)touch;
/**
接收到touch事件时是否响应边缘手势
*/
- (BOOL)edgePopGestureShouldReceiveTouch:(nullable UITouch *)touch;
/**
全屏手势冲突处理(是否取消otherGesture)
*/
- (BOOL)fullscreenPopGesture:(nullable UIGestureRecognizer *)popGesture shouldBeRequiredToFailByGestureRecognizer:(nullable UIGestureRecognizer *)otherGesture;
/**
边缘手势冲突处理(是否取消otherGesture)
*/
- (BOOL)edgePopGesture:(nullable UIGestureRecognizer *)popGesture shouldBeRequiredToFailByGestureRecognizer:(nullable UIGestureRecognizer *)otherGesture;
/**
将要开启返回手势(top viewcontroller)
*/
- (void)fullscreenPopGestureWillPopAnimation;
/**
是否取消将要完成的返回手势(top viewcontroller)
*/
- (BOOL)isCancelWillFinishPopAnimation;
/**
将要完成返回手势(top viewcontroller)
*/
- (void)fullscreenPopGestureWillFinishPopAnimation;
/**
将要取消返回手势(top viewcontroller)
*/
- (void)fullscreenPopGestureWillCancelPopAnimation;
/**
已经完成返回手势(top viewcontroller)
*/
- (void)fullscreenPopGestureDidFinishPopAnimation;
/**
已经取消返回手势(top viewcontroller)
*/
- (void)fullscreenPopGestureDidCancelPopAnimation;
@end
#pragma mark - 针对View的控制
@protocol BBAFullscreenPopGestureInViewProtocol<NSObject>
/**
支持全屏返回手势
*/
- (BOOL)supportFullscreenPopGesture;
/**
支持边缘返回手势
*/
- (BOOL)supportEdgePopGesture;
@end