This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Yep/ViewControllers/Conversation Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ class ConversationViewController: BaseViewController {
139
139
140
140
// KeyboardMan 帮助我们做键盘动画
141
141
let keyboardMan = KeyboardMan ( )
142
+ var giveUpKeyboardHideAnimationWhenViewControllerDisapeear = false
142
143
143
144
var isFirstAppear = true
144
145
@@ -442,6 +443,14 @@ class ConversationViewController: BaseViewController {
442
443
443
444
keyboardMan. animateWhenKeyboardAppear = { [ weak self] appearPostIndex, keyboardHeight, keyboardHeightIncrement in
444
445
446
+ if let giveUp = self ? . giveUpKeyboardHideAnimationWhenViewControllerDisapeear {
447
+
448
+ if giveUp {
449
+ self ? . giveUpKeyboardHideAnimationWhenViewControllerDisapeear = false
450
+ return
451
+ }
452
+ }
453
+
445
454
println ( " appear \( keyboardHeight) , \( keyboardHeightIncrement) \n " )
446
455
447
456
if let strongSelf = self {
@@ -472,6 +481,13 @@ class ConversationViewController: BaseViewController {
472
481
473
482
keyboardMan. animateWhenKeyboardDisappear = { [ weak self] keyboardHeight in
474
483
484
+ if let nvc = self ? . navigationController {
485
+ if nvc. topViewController != self {
486
+ self ? . giveUpKeyboardHideAnimationWhenViewControllerDisapeear = true
487
+ return
488
+ }
489
+ }
490
+
475
491
println ( " disappear \( keyboardHeight) \n " )
476
492
477
493
if let strongSelf = self {
You can’t perform that action at this time.
0 commit comments