MMDrawerController
enum
// 抽屉侧栏
typedef NS_ENUM(NSInteger,MMDrawerSide){
MMDrawerSideNone = 0,
MMDrawerSideLeft,
MMDrawerSideRight,
};
// 打开抽屉 手势识别模式
typedef NS_OPTIONS(NSInteger, MMOpenDrawerGestureMode) {
MMOpenDrawerGestureModeNone = 0, // 无
MMOpenDrawerGestureModePanningNavigationBar = 1 << 1,
MMOpenDrawerGestureModePanningCenterView = 1 << 2,
MMOpenDrawerGestureModeBezelPanningCenterView = 1 << 3,
MMOpenDrawerGestureModeCustom = 1 << 4,
MMOpenDrawerGestureModeAll = MMOpenDrawerGestureModePanningNavigationBar |
MMOpenDrawerGestureModePanningCenterView |
MMOpenDrawerGestureModeBezelPanningCenterView |
MMOpenDrawerGestureModeCustom,
};
// 关闭抽屉 手势识别模式
typedef NS_OPTIONS(NSInteger, MMCloseDrawerGestureMode) {
MMCloseDrawerGestureModeNone = 0,
MMCloseDrawerGestureModePanningNavigationBar = 1 << 1,
MMCloseDrawerGestureModePanningCenterView = 1 << 2,
MMCloseDrawerGestureModeBezelPanningCenterView = 1 << 3,
MMCloseDrawerGestureModeTapNavigationBar = 1 << 4,
MMCloseDrawerGestureModeTapCenterView = 1 << 5,
MMCloseDrawerGestureModePanningDrawerView = 1 << 6,
MMCloseDrawerGestureModeCustom = 1 << 7,
MMCloseDrawerGestureModeAll = MMCloseDrawerGestureModePanningNavigationBar |
MMCloseDrawerGestureModePanningCenterView |
MMCloseDrawerGestureModeBezelPanningCenterView |
MMCloseDrawerGestureModeTapNavigationBar |
MMCloseDrawerGestureModeTapCenterView |
MMCloseDrawerGestureModePanningDrawerView |
MMCloseDrawerGestureModeCustom,
};
// 打开中间控制器 交互方式
typedef NS_ENUM(NSInteger, MMDrawerOpenCenterInteractionMode) {
MMDrawerOpenCenterInteractionModeNone,
MMDrawerOpenCenterInteractionModeFull,
MMDrawerOpenCenterInteractionModeNavigationBarOnly,
};
block
// 显示状态
typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible);
propertys
@property (nonatomic, strong) UIViewController * centerViewController; // 中间控制器
@property (nonatomic, strong) UIViewController * leftDrawerViewController; // 左抽屉控制器
@property (nonatomic, strong) UIViewController * rightDrawerViewController; // 右抽屉控制器
@property (nonatomic, assign) CGFloat maximumLeftDrawerWidth; // 最大左抽屉 宽度
@property (nonatomic, assign) CGFloat maximumRightDrawerWidth; // 最大右抽屉 宽度
@property (nonatomic, assign, readonly) CGFloat visibleLeftDrawerWidth; // 可视左抽屉
@property (nonatomic, assign, readonly) CGFloat visibleRightDrawerWidth; // 可视右抽屉
@property (nonatomic, assign) CGFloat animationVelocity; // 动画速度
@property (nonatomic, assign) BOOL shouldStretchDrawer; // 需要伸展抽屉
@property (nonatomic, assign, readonly) MMDrawerSide openSide; // 打开抽屉 (左or右)
@property (nonatomic, assign) MMOpenDrawerGestureMode openDrawerGestureModeMask; // 打开抽屉 手势模式蒙版
@property (nonatomic, assign) MMCloseDrawerGestureMode closeDrawerGestureModeMask; // 关闭抽屉 手势模式蒙版
@property (nonatomic, assign) MMDrawerOpenCenterInteractionMode centerHiddenInteractionMode; 隐藏中间 交互模式
@property (nonatomic, assign) BOOL showsShadow; // 显示阴影
@property (nonatomic, assign) BOOL showsStatusBarBackgroundView; // 显示状态栏背景
@property (nonatomic, strong) UIColor * statusBarViewBackgroundColor; // 状态栏背景颜色
methods
// 初始化中间、左、右控制器
-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
// 初始化中间、左控制器
-(id)initWithCenterViewController:(UIViewController *)centerViewController leftDrawerViewController:(UIViewController *)leftDrawerViewController;
// 初始化中间、右控制器
-(id)initWithCenterViewController:(UIViewController *)centerViewController rightDrawerViewController:(UIViewController *)rightDrawerViewController;
// 点击抽屉(左or右)+动画+完成block
-(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
// 关闭抽屉动画+完成block
-(void)closeDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
// 打开抽屉(左or右)+完成block
-(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
// 设置中间控制器+关闭动画+完成block
-(void)setCenterViewController:(UIViewController *)centerViewController withCloseAnimation:(BOOL)closeAnimated completion:(void(^)(BOOL finished))completion;
// 设置中间控制器+全关动画+完成block
-(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)fullCloseAnimated completion:(void(^)(BOOL finished))completion;
// 设置最大左侧宽+动画+完成block
-(void)setMaximumLeftDrawerWidth:(CGFloat)width animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
// 设置最大右侧宽+动画+完成block
-(void)setMaximumRightDrawerWidth:(CGFloat)width animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
// 抽屉(左or右)弹性预览+完成block
-(void)bouncePreviewForDrawerSide:(MMDrawerSide)drawerSide completion:(void(^)(BOOL finished))completion;
// 抽屉(左or右)弹性预览+距离+完成block
-(void)bouncePreviewForDrawerSide:(MMDrawerSide)drawerSide distance:(CGFloat)distance completion:(void(^)(BOOL finished))completion;
// 设置抽屉可视状态block
-(void)setDrawerVisualStateBlock:(void(^)(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible))drawerVisualStateBlock;
// 设置手势完成block
-(void)setGestureCompletionBlock:(void(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture))gestureCompletionBlock;
// 设置即将手势触摸block
-(void)setGestureShouldRecognizeTouchBlock:(BOOL(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture, UITouch * touch))gestureShouldRecognizeTouchBlock;