YBAlertView.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // YBAlertView.h
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2019/11/15.
  6. // Copyright © 2019 cat. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <YYText/YYLabel.h>
  10. #import <YYText/NSAttributedString+YYText.h>
  11. typedef NS_ENUM(NSInteger,AlertFrom) {
  12. AlertFrom_Default,
  13. AlertFrom_AppUpdate, // App更新提示
  14. AlertFrom_Maintain, // App维护提示
  15. AlertFrom_YoungModel, // 青少年
  16. };
  17. typedef void (^YBAlertBlock)(int eventType);//eventType: 0 取消 1 确认
  18. @interface YBAlertView : UIView
  19. /// 确认按钮点击禁止销毁弹窗:默认-NO
  20. @property(nonatomic,assign)BOOL forbidSureDismiss;
  21. @property(nonatomic,assign)AlertFrom alertFrom;
  22. @property(nonatomic,copy)YBAlertBlock ybAlertEvent;
  23. @property (weak, nonatomic) IBOutlet UIView *bgView;
  24. @property (weak, nonatomic) IBOutlet UILabel *titleL;
  25. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleHeight;
  26. @property (weak, nonatomic) IBOutlet YYLabel *contentL;
  27. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentHeight;
  28. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentTop;
  29. @property (weak, nonatomic) IBOutlet UILabel *vLineL; //竖线
  30. @property (weak, nonatomic) IBOutlet UIButton *cancleBtn;
  31. @property (weak, nonatomic) IBOutlet UIButton *sureBtn;
  32. /**
  33. * NSDictionary *contentDic = @{@"title":@"",@"msg":@"",@"left":@"",@"right":@"",@"richImg":@""};
  34. * 其中 title 为空代表没有标题,left 为空代表只有一个按钮(右边确认按钮),
  35. * 如果msg中包含 [rich] 字段代表msg是富文本,对应 richImg 就是富文本的图片,获取 [rich] location插入图片(richImg)-->可参考'上热门'支付提示
  36. */
  37. +(instancetype)showAlertView:(NSDictionary *)contentDic complete:(YBAlertBlock)complete;
  38. @end