Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6971ed8

Browse files
committed
Merge branch 'develop' of https://github.com/CatchChat/Yep into develop
2 parents 781d1ef + 6eafb13 commit 6971ed8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Yep/ViewControllers/Conversation/ConversationViewController.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class ConversationViewController: BaseViewController {
139139

140140
// KeyboardMan 帮助我们做键盘动画
141141
let keyboardMan = KeyboardMan()
142+
var giveUpKeyboardHideAnimationWhenViewControllerDisapeear = false
142143

143144
var isFirstAppear = true
144145

@@ -442,6 +443,14 @@ class ConversationViewController: BaseViewController {
442443

443444
keyboardMan.animateWhenKeyboardAppear = { [weak self] appearPostIndex, keyboardHeight, keyboardHeightIncrement in
444445

446+
if let giveUp = self?.giveUpKeyboardHideAnimationWhenViewControllerDisapeear {
447+
448+
if giveUp {
449+
self?.giveUpKeyboardHideAnimationWhenViewControllerDisapeear = false
450+
return
451+
}
452+
}
453+
445454
println("appear \(keyboardHeight), \(keyboardHeightIncrement)\n")
446455

447456
if let strongSelf = self {
@@ -472,6 +481,13 @@ class ConversationViewController: BaseViewController {
472481

473482
keyboardMan.animateWhenKeyboardDisappear = { [weak self] keyboardHeight in
474483

484+
if let nvc = self?.navigationController {
485+
if nvc.topViewController != self {
486+
self?.giveUpKeyboardHideAnimationWhenViewControllerDisapeear = true
487+
return
488+
}
489+
}
490+
475491
println("disappear \(keyboardHeight)\n")
476492

477493
if let strongSelf = self {

0 commit comments

Comments
 (0)