| | |
| | | @param sureTitle 确认按钮标题 |
| | | */ |
| | | +(void)showInputAlertWithtitle:(NSString*)title cancleTitle:(NSString*)cancleTitle sureTitle:(NSString*)sureTitle keyboardType:(UIKeyboardType)keyboardType cancleBlock:(HDLEZAlertInputViewCancleBlock)cancle sureBlock:(HDLEZAlertInputViewSureBlock)sure{ |
| | | [[[[UIApplication sharedApplication] windows] lastObject] makeKeyWindow]; |
| | | [self showInputAlertToView:[[[UIApplication sharedApplication] windows] lastObject] title:title cancleTitle:cancleTitle sureTitle:sureTitle keyboardType:keyboardType cancleBlock:cancle sureBlock:sure]; |
| | | [[self currentWindow] makeKeyWindow]; |
| | | [self showInputAlertToView:[self currentWindow] title:title cancleTitle:cancleTitle sureTitle:sureTitle keyboardType:keyboardType cancleBlock:cancle sureBlock:sure]; |
| | | } |
| | | |
| | | /*展示输入弹窗 |
| | |
| | | } |
| | | return window; |
| | | } |
| | | |
| | | /*获取当前window |
| | | */ |
| | | +(UIWindow*)currentWindow{ |
| | | UIWindow *window; |
| | | if (@available(iOS 13.0, *)) { |
| | | if ([UIApplication sharedApplication].delegate.window) { |
| | | window=[UIApplication sharedApplication].delegate.window; |
| | | }else{ |
| | | window = [UIApplication sharedApplication].windows[0]; |
| | | } |
| | | } else { |
| | | window = [UIApplication sharedApplication].delegate.window; |
| | | } |
| | | return window; |
| | | } |
| | | @end |