UIViewController+CWLateralSlide.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // UIViewController+CWLateralSlide.h
  3. // ViewControllerTransition
  4. //
  5. // Created by chavez on 2017/6/29.
  6. // Copyright © 2017年 chavez. All rights reserved.
  7. // v1.6.4
  8. #import <UIKit/UIKit.h>
  9. #import "CWLateralSlideAnimator.h"
  10. #import "CWLateralSlideConfiguration.h"
  11. @interface UIViewController (CWLateralSlide)
  12. /*-----------------------------------v1.6.5-----------------------------------------*/
  13. /*-----------------------------------v1.6.5-----------------------------------------*/
  14. /*-----------------------------------v1.6.5-----------------------------------------*/
  15. /**
  16. 显示默认抽屉
  17. 从左侧滑出类似QQ抽屉效果
  18. @param viewController 需要侧滑显示出来的控制器
  19. */
  20. - (void)cw_showDefaultDrawerViewController:(UIViewController *)viewController;
  21. /**
  22. 呼出侧滑控制器的方法(主要)
  23. @param viewController 需要侧滑显示出来的控制器
  24. @param animationType 侧滑时候的动画类型
  25. @param configuration 侧滑过程的一些参数配置,如果传nil会创建一个默认的配置参数
  26. */
  27. - (void)cw_showDrawerViewController:(UIViewController *)viewController
  28. animationType:(CWDrawerAnimationType)animationType
  29. configuration:(CWLateralSlideConfiguration *)configuration;
  30. /**
  31. 注册手势驱动方法,侧滑呼出的方向自动确定,一般在viewDidLoad调用,调用之后会添加一个支持侧滑的手势到本控制器
  32. @param openEdgeGesture 是否开启边缘手势,系统的边缘手势判断
  33. @param transitionDirectionAutoBlock 手势过程中执行的操作。根据参数direction传整个点击present的事件即可(看demo的使用)
  34. */
  35. - (void)cw_registerShowIntractiveWithEdgeGesture:(BOOL)openEdgeGesture
  36. transitionDirectionAutoBlock:(void(^)(CWDrawerTransitionDirection direction))transitionDirectionAutoBlock;
  37. /**
  38. Custom push method 自定义的push动画
  39. push another viewController in the side slip out of the controller 在侧滑界面push另一个界面
  40. @param viewController Need to push of the controller
  41. */
  42. - (void)cw_pushViewController:(UIViewController *)viewController;
  43. /**
  44. Custom push method 自定义的push动画,比上面的API多了一个时间参数
  45. push another viewController in the side slip out of the controller. 在侧滑界面push另一个界面
  46. @param vc Need to push of the controller
  47. @param duration The Drewer Hidden Animation Duration When Push. push时抽屉隐藏动画的持续时间
  48. */
  49. - (void)cw_pushViewController:(UIViewController *)vc
  50. drewerHiddenDuration:(NSTimeInterval)duration;
  51. /**
  52. Custom present method 自定义的present动画
  53. present another viewController in the side slip out of the controller 在侧滑界面present另一个界面
  54. @param viewController Need to present of the controller
  55. */
  56. - (void)cw_presentViewController:(UIViewController *)viewController;
  57. /**
  58. Custom present method 自定义的present动画
  59. present another viewController in the side slip out of the controller 在侧滑界面present另一个界面
  60. @param vc Need to present of the controller
  61. @param hidden The Drewer isHidden . present时抽屉是否隐藏
  62. */
  63. - (void)cw_presentViewController:(UIViewController *)vc
  64. drewerHidden:(BOOL)hidden;
  65. /**
  66. Custom present method 自定义的dismiss动画
  67. 必须要是通过cw_presentViewController的控制器才能使用这个方法dismiss
  68. */
  69. - (void)cw_dismissViewController;
  70. @end