react-native-navigation的迁移库

MMDrawerController.h 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. // Copyright (c) 2013 Mutual Mobile (http://mutualmobile.com/)
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4. // of this software and associated documentation files (the "Software"), to deal
  5. // in the Software without restriction, including without limitation the rights
  6. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. // copies of the Software, and to permit persons to whom the Software is
  8. // furnished to do so, subject to the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be included in
  11. // all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. // THE SOFTWARE.
  20. #import <UIKit/UIKit.h>
  21. /**
  22. `MMDrawerController` is a side drawer navigation container view controller designed to support the growing number of applications that leverage the side drawer paradigm. This library is designed to exclusively support side drawer navigation in light-weight, focused approach.
  23. ## Creating a MMDrawerController
  24. `MMDrawerController` is a container view controller, similiar to `UINavigationController` or `UITabBarController`, with up to three child view controllers - Center, LeftDrawer, and RightDrawer. To create a `MMDrawerController`, you must first instantiate the drawer view controllers and the initial center controller, then call one of the init methods listed in this class.
  25. ## Handling a UINavigationController as the centerViewController
  26. `MMDrawerController` automatically supports handling a `UINavigationController` as the `centerViewController`, and will correctly handle the proper gestures on each view (the navigation bar view as well as the content view for the visible view controller). Note that while this library does support other container view controllers, the open/close gestures are not customized to support them.
  27. ## Accessing MMDrawerController from the Child View Controller
  28. You can leverage the category class (UIViewController+MMDrawerController) included with this library to access information about the parent `MMDrawerController`. Note that if you are contained within a UINavigationController, the `drawerContainerViewController` will still return the proper reference to the `drawerContainerViewController` parent, even though it is not the direct parent. Refer to the documentation included with the category for more information.
  29. ## How MMDrawerOpenCenterInteractionMode is handled
  30. `MMDrawerOpenCenterInteractionMode` controls how the user should be able to interact with the center view controller when either drawer is open. By default, this is set to `MMDrawerOpenCenterInteractionModeNavigationBarOnly`, which allows the user to interact with UINavigationBarItems while either drawer is open (typicaly used to click the menu button to close). If you set the interaction mode to `MMDrawerOpenCenterInteractionModeNone`, no items within the center view will be able to be interacted with while a drawer is open. Note that this setting has no effect at all on the `MMCloseDrawerGestureMode`.
  31. ## How Open/Close Gestures are handled
  32. Two gestures are added to every instance of a drawer controller, one for pan and one for touch. `MMDrawerController` is the delegate for each of the gesture recoginzers, and determines if a touch should be sent to the appropriate gesture when a touch is detected compared with the masks set for open and close gestures and the state of the drawer controller.
  33. ## Integrating with State Restoration
  34. In order to opt in to state restoration for `MMDrawerController`, you must set the `restorationIdentifier` of your drawer controller. Instances of your centerViewController, leftDrawerViewController and rightDrawerViewController must also be configured with their own `restorationIdentifier` (and optionally a restorationClass) if you intend for those to be restored as well. If your MMDrawerController had an open drawer when your app was sent to the background, that state will also be restored.
  35. ## What this library doesn't do.
  36. This library is not meant for:
  37. - Top or bottom drawer views
  38. - Displaying both drawers at one time
  39. - Displaying a minimum drawer width
  40. - Support container view controllers other than `UINavigationController` as the center view controller.
  41. */
  42. typedef NS_ENUM(NSInteger,MMDrawerSide){
  43. MMDrawerSideNone = 0,
  44. MMDrawerSideLeft,
  45. MMDrawerSideRight,
  46. };
  47. typedef NS_OPTIONS(NSInteger, MMOpenDrawerGestureMode) {
  48. MMOpenDrawerGestureModeNone = 0,
  49. MMOpenDrawerGestureModePanningNavigationBar = 1 << 1,
  50. MMOpenDrawerGestureModePanningCenterView = 1 << 2,
  51. MMOpenDrawerGestureModeBezelPanningCenterView = 1 << 3,
  52. MMOpenDrawerGestureModeCustom = 1 << 4,
  53. MMOpenDrawerGestureModeAll = MMOpenDrawerGestureModePanningNavigationBar |
  54. MMOpenDrawerGestureModePanningCenterView |
  55. MMOpenDrawerGestureModeBezelPanningCenterView |
  56. MMOpenDrawerGestureModeCustom,
  57. };
  58. typedef NS_OPTIONS(NSInteger, MMCloseDrawerGestureMode) {
  59. MMCloseDrawerGestureModeNone = 0,
  60. MMCloseDrawerGestureModePanningNavigationBar = 1 << 1,
  61. MMCloseDrawerGestureModePanningCenterView = 1 << 2,
  62. MMCloseDrawerGestureModeBezelPanningCenterView = 1 << 3,
  63. MMCloseDrawerGestureModeTapNavigationBar = 1 << 4,
  64. MMCloseDrawerGestureModeTapCenterView = 1 << 5,
  65. MMCloseDrawerGestureModePanningDrawerView = 1 << 6,
  66. MMCloseDrawerGestureModeCustom = 1 << 7,
  67. MMCloseDrawerGestureModeAll = MMCloseDrawerGestureModePanningNavigationBar |
  68. MMCloseDrawerGestureModePanningCenterView |
  69. MMCloseDrawerGestureModeBezelPanningCenterView |
  70. MMCloseDrawerGestureModeTapNavigationBar |
  71. MMCloseDrawerGestureModeTapCenterView |
  72. MMCloseDrawerGestureModePanningDrawerView |
  73. MMCloseDrawerGestureModeCustom,
  74. };
  75. typedef NS_ENUM(NSInteger, MMDrawerOpenCenterInteractionMode) {
  76. MMDrawerOpenCenterInteractionModeNone,
  77. MMDrawerOpenCenterInteractionModeFull,
  78. MMDrawerOpenCenterInteractionModeNavigationBarOnly,
  79. };
  80. @class MMDrawerController;
  81. typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible);
  82. @interface MMDrawerController : UIViewController
  83. ///---------------------------------------
  84. /// @name Accessing Drawer Container View Controller Properties
  85. ///---------------------------------------
  86. /**
  87. The center view controller.
  88. This can only be set via the init methods, as well as the `setNewCenterViewController:...` methods. The size of this view controller will automatically be set to the size of the drawer container view controller, and it's position is modified from within this class. Do not modify the frame externally.
  89. */
  90. @property (nonatomic, strong) UIViewController * centerViewController;
  91. /**
  92. The left drawer view controller.
  93. The size of this view controller is managed within this class, and is automatically set to the appropriate size based on the `maximumLeftDrawerWidth`. Do not modify the frame externally.
  94. */
  95. @property (nonatomic, strong) UIViewController * leftDrawerViewController;
  96. /**
  97. The right drawer view controller.
  98. The size of this view controller is managed within this class, and is automatically set to the appropriate size based on the `maximumRightDrawerWidth`. Do not modify the frame externally.
  99. */
  100. @property (nonatomic, strong) UIViewController * rightDrawerViewController;
  101. /**
  102. The maximum width of the `leftDrawerViewController`.
  103. By default, this is set to 280. If the `leftDrawerViewController` is nil, this property will return 0.0;
  104. */
  105. @property (nonatomic, assign) CGFloat maximumLeftDrawerWidth;
  106. /**
  107. The maximum width of the `rightDrawerViewController`.
  108. By default, this is set to 280. If the `rightDrawerViewController` is nil, this property will return 0.0;
  109. */
  110. @property (nonatomic, assign) CGFloat maximumRightDrawerWidth;
  111. /**
  112. The visible width of the `leftDrawerViewController`.
  113. Note this value can be greater than `maximumLeftDrawerWidth` during the full close animation when setting a new center view controller;
  114. */
  115. @property (nonatomic, assign, readonly) CGFloat visibleLeftDrawerWidth;
  116. /**
  117. The visible width of the `rightDrawerViewController`.
  118. Note this value can be greater than `maximumRightDrawerWidth` during the full close animation when setting a new center view controller;
  119. */
  120. @property (nonatomic, assign, readonly) CGFloat visibleRightDrawerWidth;
  121. /**
  122. The animation velocity of the open and close methods, measured in points per second.
  123. By default, this is set to 840 points per second (three times the default drawer width), meaning it takes 1/3 of a second for the `centerViewController` to open/close across the default drawer width. Note that there is a minimum .1 second duration for built in animations, to account for small distance animations.
  124. */
  125. @property (nonatomic, assign) CGFloat animationVelocity;
  126. /**
  127. A boolean that determines whether or not the panning gesture will "hard-stop" at the maximum width for a given drawer side.
  128. By default, this value is set to YES. Enabling `shouldStretchDrawer` will give the pan a gradual asymptotic stopping point much like `UIScrollView` behaves. Note that if this value is set to YES, the `drawerVisualStateBlock` can be passed a `percentVisible` greater than 1.0, so be sure to handle that case appropriately.
  129. */
  130. @property (nonatomic, assign) BOOL shouldStretchDrawer;
  131. /**
  132. The current open side of the drawer.
  133. Note this value will change as soon as a pan gesture opens a drawer, or when a open/close animation is finished.
  134. */
  135. @property (nonatomic, assign, readonly) MMDrawerSide openSide;
  136. /**
  137. How a user is allowed to open a drawer using gestures.
  138. By default, this is set to `MMOpenDrawerGestureModeNone`. Note these gestures may affect user interaction with the `centerViewController`, so be sure to use appropriately.
  139. */
  140. @property (nonatomic, assign) MMOpenDrawerGestureMode openDrawerGestureModeMask;
  141. /**
  142. How a user is allowed to close a drawer.
  143. By default, this is set to `MMCloseDrawerGestureModeNone`. Note these gestures may affect user interaction with the `centerViewController`, so be sure to use appropriately.
  144. */
  145. @property (nonatomic, assign) MMCloseDrawerGestureMode closeDrawerGestureModeMask;
  146. /**
  147. The value determining if the user can interact with the `centerViewController` when a side drawer is open.
  148. By default, it is `MMDrawerOpenCenterInteractionModeNavigationBarOnly`, meaning that the user can only interact with the buttons on the `UINavigationBar`, if the center view controller is a `UINavigationController`. Otherwise, the user cannot interact with any other center view controller elements.
  149. */
  150. @property (nonatomic, assign) MMDrawerOpenCenterInteractionMode centerHiddenInteractionMode;
  151. /**
  152. The flag determining if a shadow should be drawn off of `centerViewController` when a drawer is open.
  153. By default, this is set to YES.
  154. */
  155. @property (nonatomic, assign) BOOL showsShadow;
  156. /**
  157. The shadow radius of `centerViewController` when a drawer is open.
  158. By default, this is set to 10.0f;
  159. */
  160. @property (nonatomic, assign) CGFloat shadowRadius;
  161. /**
  162. The shadow opacity of `centerViewController` when a drawer is open.
  163. By default, this is set to 0.8f;
  164. */
  165. @property (nonatomic, assign) CGFloat shadowOpacity;
  166. /**
  167. The shadow offset of `centerViewController` when a drawer is open.
  168. By default, this is set to (0, -3);
  169. */
  170. @property (nonatomic, assign) CGSize shadowOffset;
  171. /**
  172. The color of the shadow drawn off of 'centerViewController` when a drawer is open.
  173. By default, this is set to the systme default (opaque black).
  174. */
  175. @property (nonatomic, strong) UIColor * shadowColor;
  176. @property (nonatomic, assign) BOOL leftSideEnabled;
  177. @property (nonatomic, assign) BOOL rightSideEnabled;
  178. /**
  179. The flag determining if a custom background view should appear beneath the status bar, forcing the child content to be drawn lower than the status bar.
  180. By default, this is set to NO.
  181. */
  182. @property (nonatomic, assign) BOOL showsStatusBarBackgroundView;
  183. /**
  184. The color of the status bar background view if `showsStatusBarBackgroundView` is set to YES.
  185. By default, this is set `[UIColor blackColor]`.
  186. */
  187. @property (nonatomic, strong) UIColor * statusBarViewBackgroundColor;
  188. /**
  189. The value determining panning range of centerView's bezel if the user can open drawer with 'MMOpenDrawerGestureModeBezelPanningCenterView' or close drawer with 'MMCloseDrawerGestureModeBezelPanningCenterView' .
  190. By default, this is set 20.0f.
  191. */
  192. @property (nonatomic, assign) CGFloat bezelPanningCenterViewRange;
  193. /**
  194. The value determining if the user can open or close drawer with panGesture velocity.
  195. By default, this is set 200.0f.
  196. */
  197. @property (nonatomic, assign) CGFloat panVelocityXAnimationThreshold;
  198. ///---------------------------------------
  199. /// @name Initializing a `MMDrawerController`
  200. ///---------------------------------------
  201. /**
  202. Creates and initializes an `MMDrawerController` object with the specified center view controller, left drawer view controller, and right drawer view controller.
  203. @param centerViewController The center view controller. This argument must not be `nil`.
  204. @param leftDrawerViewController The left drawer view controller.
  205. @param rightDrawerViewController The right drawer controller.
  206. @return The newly-initialized drawer container view controller.
  207. */
  208. -(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
  209. /**
  210. Creates and initializes an `MMDrawerController` object with the specified center view controller, left drawer view controller.
  211. @param centerViewController The center view controller. This argument must not be `nil`.
  212. @param leftDrawerViewController The left drawer view controller.
  213. @return The newly-initialized drawer container view controller.
  214. */
  215. -(instancetype)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController;
  216. /**
  217. Creates and initializes an `MMDrawerController` object with the specified center view controller, right drawer view controller.
  218. @param centerViewController The center view controller. This argument must not be `nil`.
  219. @param rightDrawerViewController The right drawer controller.
  220. @return The newly-initialized drawer container view controller.
  221. */
  222. -(instancetype)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
  223. ///---------------------------------------
  224. /// @name Opening and Closing a Drawer
  225. ///---------------------------------------
  226. /**
  227. Toggles the drawer open/closed based on the `drawer` passed in.
  228. Note that if you attempt to toggle a drawer closed while the other is open, nothing will happen. For example, if you pass in MMDrawerSideLeft, but the right drawer is open, nothing will happen. In addition, the completion block will be called with the finished flag set to NO.
  229. @param drawerSide The `MMDrawerSide` to toggle. This value cannot be `MMDrawerSideNone`.
  230. @param animated Determines whether the `drawer` should be toggle animated.
  231. @param completion The block that is called when the toggle is complete, or if no toggle took place at all.
  232. */
  233. -(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
  234. /**
  235. Closes the open drawer.
  236. @param animated Determines whether the drawer side should be closed animated
  237. @param completion The block that is called when the close is complete
  238. */
  239. -(void)closeDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
  240. /**
  241. Opens the `drawer` passed in.
  242. @param drawerSide The `MMDrawerSide` to open. This value cannot be `MMDrawerSideNone`.
  243. @param animated Determines whether the `drawer` should be open animated.
  244. @param completion The block that is called when the toggle is open.
  245. */
  246. -(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
  247. ///---------------------------------------
  248. /// @name Setting a new Center View Controller
  249. ///---------------------------------------
  250. /**
  251. Sets the new `centerViewController`.
  252. This sets the view controller and will automatically adjust the frame based on the current state of the drawer controller. If `closeAnimated` is YES, it will immediately change the center view controller, and close the drawer from its current position.
  253. @param centerViewController The new `centerViewController`.
  254. @param closeAnimated Determines whether the drawer should be closed with an animation.
  255. @param completion The block called when the animation is finsihed.
  256. */
  257. -(void)setCenterViewController:(UIViewController *)centerViewController withCloseAnimation:(BOOL)closeAnimated completion:(void(^)(BOOL finished))completion;
  258. /**
  259. Sets the new `centerViewController.overlayViewColor`.
  260. This sets the overlay view color
  261. @param color The new `UIColor`.
  262. */
  263. -(void)setCenterOverlayColor:(UIColor*)color;
  264. /**
  265. Sets the new `centerViewController`.
  266. This sets the view controller and will automatically adjust the frame based on the current state of the drawer controller. If `closeFullAnimated` is YES, the current center view controller will animate off the screen, the new center view controller will then be set, followed by the drawer closing across the full width of the screen.
  267. @param newCenterViewController The new `centerViewController`.
  268. @param fullCloseAnimated Determines whether the drawer should be closed with an animation.
  269. @param completion The block called when the animation is finsihed.
  270. */
  271. -(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)fullCloseAnimated completion:(void(^)(BOOL finished))completion;
  272. ///---------------------------------------
  273. /// @name Animating the Width of a Drawer
  274. ///---------------------------------------
  275. /**
  276. Sets the maximum width of the left drawer view controller.
  277. If the drawer is open, and `animated` is YES, it will animate the drawer frame as well as adjust the center view controller. If the drawer is not open, this change will take place immediately.
  278. @param width The new width of left drawer view controller. This must be greater than zero.
  279. @param animated Determines whether the drawer should be adjusted with an animation.
  280. @param completion The block called when the animation is finished.
  281. */
  282. -(void)setMaximumLeftDrawerWidth:(CGFloat)width animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
  283. /**
  284. Sets the maximum width of the right drawer view controller.
  285. If the drawer is open, and `animated` is YES, it will animate the drawer frame as well as adjust the center view controller. If the drawer is not open, this change will take place immediately.
  286. @param width The new width of right drawer view controller. This must be greater than zero.
  287. @param animated Determines whether the drawer should be adjusted with an animation.
  288. @param completion The block called when the animation is finished.
  289. */
  290. -(void)setMaximumRightDrawerWidth:(CGFloat)width animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
  291. ///---------------------------------------
  292. /// @name Previewing a Drawer
  293. ///---------------------------------------
  294. /**
  295. Bounce preview for the specified `drawerSide` a distance of 40 points.
  296. @param drawerSide The drawer to preview. This value cannot be `MMDrawerSideNone`.
  297. @param completion The block called when the animation is finsihed.
  298. */
  299. -(void)bouncePreviewForDrawerSide:(MMDrawerSide)drawerSide completion:(void(^)(BOOL finished))completion;
  300. /**
  301. Bounce preview for the specified `drawerSide`.
  302. @param drawerSide The drawer side to preview. This value cannot be `MMDrawerSideNone`.
  303. @param distance The distance to bounce.
  304. @param completion The block called when the animation is finsihed.
  305. */
  306. -(void)bouncePreviewForDrawerSide:(MMDrawerSide)drawerSide distance:(CGFloat)distance completion:(void(^)(BOOL finished))completion;
  307. ///---------------------------------------
  308. /// @name Custom Drawer Animations
  309. ///---------------------------------------
  310. /**
  311. Sets a callback to be called when a drawer visual state needs to be updated.
  312. This block is responsible for updating the drawer's view state, and the drawer controller will handle animating to that state from the current state. This block will be called when the drawer is opened or closed, as well when the user is panning the drawer. This block is not responsible for doing animations directly, but instead just updating the state of the properies (such as alpha, anchor point, transform, etc). Note that if `shouldStretchDrawer` is set to YES, it is possible for `percentVisible` to be greater than 1.0. If `shouldStretchDrawer` is set to NO, `percentVisible` will never be greater than 1.0.
  313. Note that when the drawer is finished opening or closing, the side drawer controller view will be reset with the following properies:
  314. - alpha: 1.0
  315. - transform: CATransform3DIdentity
  316. - anchorPoint: (0.5,0.5)
  317. @param drawerVisualStateBlock A block object to be called that allows the implementer to update visual state properties on the drawer. `percentVisible` represents the amount of the drawer space that is current visible, with drawer space being defined as the edge of the screen to the maxmimum drawer width. Note that you do have access to the drawerController, which will allow you to update things like the anchor point of the side drawer layer.
  318. */
  319. -(void)setDrawerVisualStateBlock:(void(^)(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible))drawerVisualStateBlock;
  320. ///---------------------------------------
  321. /// @name Gesture Completion Handling
  322. ///---------------------------------------
  323. /**
  324. Sets a callback to be called when a gesture has been completed.
  325. This block is called when a gesture action has been completed. You can query the `openSide` of the `drawerController` to determine what the new state of the drawer is.
  326. @param gestureCompletionBlock A block object to be called that allows the implementer be notified when a gesture action has been completed.
  327. */
  328. -(void)setGestureCompletionBlock:(void(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture))gestureCompletionBlock;
  329. ///---------------------------------------
  330. /// @name Gesture Start Handling
  331. ///---------------------------------------
  332. /**
  333. Sets a callback to be called when a gesture starts
  334. This block is called when a gesture action has started.
  335. @param gestureStartBlock A block object to be called that allows the implementer be notified when a gesture action has started.
  336. */
  337. -(void)setGestureStartBlock:(void (^)(MMDrawerController *, UIGestureRecognizer *))gestureStartBlock;
  338. ///---------------------------------------
  339. /// @name Custom Gesture Handler
  340. ///---------------------------------------
  341. /**
  342. Sets a callback to be called to determine if a UIGestureRecognizer should recieve the given UITouch.
  343. This block provides a way to allow a gesture to be recognized with custom logic. For example, you may have a certain part of your view that should accept a pan gesture recognizer to open the drawer, but not another a part. If you return YES, the gesture is recognized and the appropriate action is taken. This provides similar support to how Facebook allows you to pan on the background view of the main table view, but not the content itself. You can inspect the `openSide` property of the `drawerController` to determine the current state of the drawer, and apply the appropriate logic within your block.
  344. Note that either `openDrawerGestureModeMask` must contain `MMOpenDrawerGestureModeCustom`, or `closeDrawerGestureModeMask` must contain `MMCloseDrawerGestureModeCustom` for this block to be consulted.
  345. @param gestureShouldRecognizeTouchBlock A block object to be called to determine if the given `touch` should be recognized by the given gesture.
  346. */
  347. -(void)setGestureShouldRecognizeTouchBlock:(BOOL(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture, UITouch * touch))gestureShouldRecognizeTouchBlock;
  348. @end