// // YMPopupViewProtocol.h // yuemoClient // // Created by YoMi on 2023/11/6. // #import @class YMPopupView; typedef void (^ _Nullable YmVoidBlock)(void); typedef void (^ _Nullable YmPointBlock)(CGPoint point); typedef void (^ _Nullable YmAlertCountDownBlock)(YMPopupView * _Nonnull popView,NSTimeInterval timeInterval); typedef void (^ _Nullable YmKeyBoardChangeBlock)(CGRect beginFrame,CGRect endFrame,CGFloat duration); typedef UIView * _Nonnull (^ _Nullable YmViewBlock)(void); /** 调试日志类型 */ typedef NS_ENUM(NSInteger, YMPopupViewLogStyle) { YMPopupViewLogStyleNO = 0, // 关闭调试信息(窗口和控制台日志输出) YMPopupViewLogStyleWindow, // 开启左上角小窗 YMPopupViewLogStyleConsole, // 开启控制台日志输出 YMPopupViewLogStyleALL // 开启小窗和控制台日志 }; /** 显示动画样式 */ typedef NS_ENUM(NSInteger, YMPopupStyle) { YMPopupStyleFade = 0, // 默认 渐变出现 YMPopupStyleNO, // 无动画 YMPopupStyleScale, // 缩放 先放大 后恢复至原大小 YMPopupStyleTop, // 顶部 YMPopupStyleSmoothFromTop, // 顶部 平滑淡入动画 YMPopupStyleSmoothFromLeft, // 左侧 平滑淡入动画 YMPopupStyleSmoothFromBottom, // 底部 平滑淡入动画 YMPopupStyleSmoothFromRight, // 右侧 平滑淡入动画 YMPopupStyleSpringFromTop, // 顶部 平滑淡入动画 带弹簧 YMPopupStyleSpringFromLeft, // 左侧 平滑淡入动画 带弹簧 YMPopupStyleSpringFromBottom, // 底部 平滑淡入动画 带弹簧 YMPopupStyleSpringFromRight, // 右侧 平滑淡入动画 带弹簧 YMPopupStyleCardDropFromLeft, // 顶部左侧 掉落动画 YMPopupStyleCardDropFromRight, // 顶部右侧 掉落动画 }; /** 消失动画样式 */ typedef NS_ENUM(NSInteger, YMDismissStyle) { YMDismissStyleFade = 0, // 默认 渐变消失 YMDismissStyleNO, // 无动画 YMDismissStyleScale, // 缩放 YMDismissStyleTop, // 顶部 YMDismissStyleSmoothToTop, // 顶部 平滑淡出动画 YMDismissStyleSmoothToLeft, // 左侧 平滑淡出动画 YMDismissStyleSmoothToBottom, // 底部 平滑淡出动画 YMDismissStyleSmoothToRight, // 右侧 平滑淡出动画 YMDismissStyleCardDropToLeft, // 卡片从中间往左侧掉落 YMDismissStyleCardDropToRight, // 卡片从中间往右侧掉落 YMDismissStyleCardDropToTop, // 卡片从中间往顶部移动消失 }; /** 主动动画样式(开发中) */ typedef NS_ENUM(NSInteger, YMActivityStyle) { YMActivityStyleNO = 0, /// 无动画 YMActivityStyleScale, /// 缩放 YMActivityStyleShake, /// 抖动 }; /** 弹窗位置 */ typedef NS_ENUM(NSInteger, YMPositionStyle) { YMPositionStyleCenter = 0, //居中 YMPositionStyleTop, //贴顶 YMPositionStyleLeft, //贴左 YMPositionStyleBottom, //贴底 YMPositionStyleRight, //贴右 YMPositionStyleTopLeft, //贴顶和左 YMPositionStyleBottomLeft, //贴底和左 YMPositionStyleBottomRight, //贴底和右 YMPositionStyleTopRight //贴顶和右 }; /** 拖拽方向 */ typedef NS_ENUM(NSInteger, YMDragStyle) { YMDragStyleNO = 0, //默认 不能拖拽窗口 YMDragStyleX_Positive = 1<<0, //X轴正方向拖拽 YMDragStyleX_Negative = 1<<1, //X轴负方向拖拽 YMDragStyleY_Positive = 1<<2, //Y轴正方向拖拽 YMDragStyleY_Negative = 1<<3, //Y轴负方向拖拽 YMDragStyleX = (YMDragStyleX_Positive|YMDragStyleX_Negative), //X轴方向拖拽 YMDragStyleY = (YMDragStyleY_Positive|YMDragStyleY_Negative), //Y轴方向拖拽 YMDragStyleAll = (YMDragStyleX|YMDragStyleY) //全向拖拽 }; ///** 可轻扫消失的方向 */ typedef NS_ENUM(NSInteger, YMSweepStyle) { YMSweepStyleNO = 0, //默认 不能拖拽窗口 YMSweepStyleX_Positive = 1<<0, //X轴正方向拖拽 YMSweepStyleX_Negative = 1<<1, //X轴负方向拖拽 YMSweepStyleY_Positive = 1<<2, //Y轴正方向拖拽 YMSweepStyleY_Negative = 1<<3, //Y轴负方向拖拽 YMSweepStyleX = (YMSweepStyleX_Positive|YMSweepStyleX_Negative), //X轴方向拖拽 YMSweepStyleY = (YMSweepStyleY_Positive|YMSweepStyleY_Negative), //Y轴方向拖拽 YMSweepStyleALL = (YMSweepStyleX|YMSweepStyleY) //全向轻扫 }; /** 可轻扫消失动画类型 对单向横扫 设置有效 YMSweepDismissStyleSmooth: 自动适应选择以下其一 YMDismissStyleSmoothToTop, YMDismissStyleSmoothToLeft, YMDismissStyleSmoothToBottom , YMDismissStyleSmoothToRight */ typedef NS_ENUM(NSInteger, YMSweepDismissStyle) { YMSweepDismissStyleVelocity = 0, //默认加速度 移除 YMSweepDismissStyleSmooth = 1 //平顺移除 }; NS_ASSUME_NONNULL_BEGIN @protocol YMPopupViewProtocol /** 点击弹窗 回调 */ - (void)popupViewBgClickForPopView:(YMPopupView *)popView; /** 长按弹窗 回调 */ - (void)popupViewBgLongPressForPopView:(YMPopupView *)popView; /** 将要显示 */ - (void)popupViewWillPopForPopView:(YMPopupView *)popView; /** 已经显示完毕 */ - (void)popupViewDidPopForPopView:(YMPopupView *)popView; /** 倒计时进行中 timeInterval:时长 */ - (void)popupViewCountDownForPopView:(YMPopupView *)popView forCountDown:(NSTimeInterval)timeInterval; /** 倒计时倒计时完成 */ - (void)popupViewCountDownFinishForPopView:(YMPopupView *)popView; /** 将要开始移除 */ - (void)popupViewWillDismissForPopView:(YMPopupView *)popView; /** 已经移除完毕 */ - (void)popupViewDidDismissForPopView:(YMPopupView *)popView; @end NS_ASSUME_NONNULL_END