HomeAuthAlertView.m 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // HomeAuthAlertView.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/8/24.
  6. //
  7. #import "HomeAuthAlertView.h"
  8. @interface HomeAuthAlertView ()
  9. @property (nonatomic, copy) AuthAlertCallback callback;
  10. @property (weak, nonatomic) IBOutlet UIButton *authButton;
  11. @end
  12. @implementation HomeAuthAlertView
  13. - (void)awakeFromNib {
  14. [super awakeFromNib];
  15. self.educationImage.layer.borderWidth = 1.0f;
  16. self.educationImage.layer.borderColor = THEMECOLOR.CGColor;
  17. self.qualificationImage.layer.borderWidth = 1.0f;
  18. self.qualificationImage.layer.borderColor = THEMECOLOR.CGColor;
  19. }
  20. + (instancetype)shareIntance {
  21. HomeAuthAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeAuthAlertView" owner:nil options:nil] firstObject];
  22. view.frame = CGRectMake(0, 0, KPortraitWidth, KPortraitHeight);
  23. return view;
  24. }
  25. - (void)showAlertView {
  26. [[NSObject getKeyWindow] addSubview:self];
  27. }
  28. - (void)authEducationAction:(AuthAlertCallback)callback {
  29. if (callback) {
  30. self.callback = callback;
  31. }
  32. }
  33. - (IBAction)cancleAction:(id)sender {
  34. [self removeFromSuperview];
  35. }
  36. - (IBAction)vefiAction:(id)sender {
  37. if (self.callback) {
  38. if (self.isFinish == NO) {
  39. self.callback();
  40. }
  41. }
  42. [self removeFromSuperview];
  43. }
  44. - (void)setIsFinish:(BOOL)isFinish {
  45. _isFinish = isFinish;
  46. NSString *desc = @"去认证";
  47. if (isFinish) {
  48. desc = @"我知道了";
  49. }
  50. [self.authButton setTitle:desc forState:UIControlStateNormal];
  51. }
  52. /*
  53. // Only override drawRect: if you perform custom drawing.
  54. // An empty implementation adversely affects performance during animation.
  55. - (void)drawRect:(CGRect)rect {
  56. // Drawing code
  57. }
  58. */
  59. @end