Browse Source

问题修复

Steven 5 months ago
parent
commit
7cd8e69246

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/xcshareddata/xcschemes/KulexiuForTeacher.xcscheme

@@ -93,7 +93,7 @@
       buildConfiguration = "Debug">
    </AnalyzeAction>
    <ArchiveAction
-      buildConfiguration = "Release"
+      buildConfiguration = "TEST"
       revealArchiveInOrganizer = "YES">
    </ArchiveAction>
 </Scheme>

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/LoadingManager/KSHudLoagingManager.m

@@ -50,6 +50,7 @@
     dispatch_main_async_safe(^{
         if (self->_loadingView) {
             [self.loadingView hideLoadingView];
+            self->_loadingView = nil;
         }
     });
 }
@@ -84,6 +85,7 @@
     dispatch_main_async_safe(^{
         if (self.HUD) {
             [self.HUD removeFromSuperview];
+            self->_HUD = nil;
         }
         [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
     });

+ 0 - 14
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Controller/KSChatConversationViewController.m

@@ -53,20 +53,6 @@
     }];
 }
 
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-
-    //TODO: 页面appear 禁用
-   [[IQKeyboardManager sharedManager] setEnable:NO];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-
-    //TODO: 页面Disappear 启用
-   [[IQKeyboardManager sharedManager] setEnable:YES];
-}
-
 - (void)clearConversation {
     
     NSString *conversationID = [NSString stringWithFormat:@"c2c_%@",self.conversation.userID];

+ 0 - 13
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Controller/KSGroupConversationController.m

@@ -26,19 +26,6 @@
     [self requestData];
 }
 
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-
-    //TODO: 页面appear 禁用
-   [[IQKeyboardManager sharedManager] setEnable:NO];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-
-    //TODO: 页面Disappear 启用
-   [[IQKeyboardManager sharedManager] setEnable:YES];
-}
 
 - (void)clearConversation {
     

+ 12 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Controller/TXCustom/KSTXBaseChatViewController.m

@@ -30,7 +30,19 @@ static UIView *gCustomTopView;
 
 @implementation KSTXBaseChatViewController
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    // 页面appear 禁用
+    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
+    [IQKeyboardManager sharedManager].enable = NO;
+}
 
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    // 页面Disappear 启用
+    [IQKeyboardManager sharedManager].enableAutoToolbar = YES;
+    [IQKeyboardManager sharedManager].enable = YES;
+}
 
 #pragma mark - Life Cycle
 

+ 11 - 0
KulexiuForTeacher/Pods/TUIChat/TUIChat/UI_Classic/Chat/TUIBaseChatViewController.m

@@ -224,6 +224,17 @@ static CGRect gCustomTopViewRect;
 
 - (void)viewDidDisappear:(BOOL)animated {
     [super viewDidDisappear:animated];
+    if (self.inputController.status == Input_Status_Input || self.inputController.status == Input_Status_Input_Keyboard) {
+        CGPoint offset = self.messageController.tableView.contentOffset;
+        __weak typeof(self) weakSelf = self;
+        dispatch_async(dispatch_get_main_queue(), ^{
+          __strong typeof(weakSelf) strongSelf = weakSelf;
+          strongSelf.responseKeyboard = YES;
+          [UIApplication.sharedApplication.keyWindow endEditing:YES];
+          [strongSelf inputController:strongSelf.inputController didChangeHeight:CGRectGetMaxY(strongSelf.inputController.inputBar.frame) + Bottom_SafeHeight];
+          [strongSelf.messageController.tableView setContentOffset:offset];
+        });
+    }
 }
 
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations{