// // APHomeActiveWindow.m // westkissMob // // Created by iOS on 2023/5/26. // #import "APHomeActiveWindow.h" #import "APHomeActiveViewController.h" #import "APInputAlertView.h" @interface APHomeActiveWindow () @property (nonatomic, strong) APHomeActiveViewController *vc; @end @implementation APHomeActiveWindow - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self createVc]; } return self; } - (void)createVc { self.windowLevel = UIWindowLevelStatusBar + 3; self.vc = [[APHomeActiveViewController alloc] init]; self.vc.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0.4]; self.rootViewController = self.vc; [self makeKeyAndVisible]; } // 输入框弹窗 + (APHomeActiveWindow *)show:(NSString *)title des:(NSString *)des sureBlock:(void(^)(NSString*))success cancelBlock:(void(^)(void))cancel { APInputAlertView *contentV = [[APInputAlertView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; [contentV setTitle:title des:des]; APHomeActiveWindow *w = [[APHomeActiveWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; w.backgroundColor = UIColor.clearColor; ASWindowManager.share.activeW = w; [w.vc.view addSubview:contentV]; [contentV mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.trailing.leading.equalTo(w.vc.view); }]; contentV.sureAction = success; contentV.cancelAction = cancel; contentV.closeAction = cancel; return w; } @end