// // ASCustomWindow.m // Asteria // // Created by iOS on 2023/12/23. // #import "ASCustomWindow.h" @implementation ASCustomWindow - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self createVc]; } return self; } - (void)createVc { self.windowLevel = UIWindowLevelStatusBar + 3; self.vc = [[ASCustomAlertViewController alloc] init]; self.rootViewController = self.vc; [self makeKeyAndVisible]; } + (ASCustomWindow *)show:(NSString *)version isMast:(BOOL)isMast upBlock:(void(^)(void))success cancelBlock:(void(^)(void))cancel { ASCustomWindow *w = [[ASCustomWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; w.backgroundColor = UIColor.clearColor; ASWindowManager.share.customW = w; w.vc.conetntLb.text = version; [w.vc setMastStatus:isMast]; w.vc.sureAction = ^{ success(); }; w.vc.cancelAction = ^{ cancel(); }; w.vc.closeAction = ^{ }; return w; } @end