补充提交
This commit is contained in:
@@ -342,6 +342,30 @@
|
||||
#pragma mark - Text input
|
||||
#pragma mark-- UITextViewDelegate
|
||||
- (void)textViewDidBeginEditing:(UITextView *)textView {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
NSString* canChatMoney = [[NSUserDefaults standardUserDefaults] objectForKey:@"kIsCanChatMoney"];
|
||||
if (isCanChat != 1) {
|
||||
[self.inputTextView resignFirstResponder];
|
||||
UIWindow*keyWindow = nil;
|
||||
NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
for (UIWindow *window in windows){
|
||||
if(window.isKeyWindow){
|
||||
keyWindow = window;
|
||||
break;
|
||||
}
|
||||
}
|
||||
UINavigationController*na = (UINavigationController*)keyWindow.rootViewController;
|
||||
NSString *title = [NSString stringWithFormat:@"充值不足%@元,您无法发送消息",canChatMoney];
|
||||
UIAlertController *al = [UIAlertController alertControllerWithTitle:title message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"去充值" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
|
||||
[na pushViewController:[[NSClassFromString(@"QXRechargeViewcController") alloc] init] animated:YES];
|
||||
}]];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
}]];
|
||||
[na presentViewController:al animated:YES completion:nil];
|
||||
return;
|
||||
}
|
||||
self.keyboardButton.hidden = YES;
|
||||
self.micButton.hidden = NO;
|
||||
self.faceButton.hidden = NO;
|
||||
|
||||
Reference in New Issue
Block a user