12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- //
- // HomeAuthAlertView.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2022/8/24.
- //
- #import "HomeAuthAlertView.h"
- @interface HomeAuthAlertView ()
- @property (nonatomic, copy) AuthAlertCallback callback;
- @property (weak, nonatomic) IBOutlet UIButton *authButton;
- @end
- @implementation HomeAuthAlertView
- - (void)awakeFromNib {
- [super awakeFromNib];
- self.educationImage.layer.borderWidth = 1.0f;
- self.educationImage.layer.borderColor = THEMECOLOR.CGColor;
- self.qualificationImage.layer.borderWidth = 1.0f;
- self.qualificationImage.layer.borderColor = THEMECOLOR.CGColor;
- }
- + (instancetype)shareIntance {
- HomeAuthAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"HomeAuthAlertView" owner:nil options:nil] firstObject];
- view.frame = CGRectMake(0, 0, KPortraitWidth, KPortraitHeight);
- return view;
- }
- - (void)showAlertView {
- [[NSObject getKeyWindow] addSubview:self];
- }
- - (void)authEducationAction:(AuthAlertCallback)callback {
- if (callback) {
- self.callback = callback;
- }
- }
- - (IBAction)cancleAction:(id)sender {
- [self removeFromSuperview];
- }
- - (IBAction)vefiAction:(id)sender {
- if (self.callback) {
- if (self.isFinish == NO) {
- self.callback();
- }
- }
- [self removeFromSuperview];
- }
- - (void)setIsFinish:(BOOL)isFinish {
- _isFinish = isFinish;
- NSString *desc = @"去认证";
- if (isFinish) {
- desc = @"我知道了";
- }
- [self.authButton setTitle:desc forState:UIControlStateNormal];
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|