Skip to content

Commit

Permalink
Add handling tab bar inset while keyboard showing
Browse files Browse the repository at this point in the history
  • Loading branch information
Flatout73 authored Nov 11, 2018
1 parent 96bd759 commit b91f205
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nMessenger/Source/Messenger/NMessengerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,19 @@ open class NMessengerViewController: UIViewController, UITextViewDelegate, NMess
self.inputBarBottomSpacing.constant = 0
self.isKeyboardIsShown = false
} else {
if self.inputBarBottomSpacing.constant==0{
self.inputBarBottomSpacing.constant -= endFrame?.size.height ?? 0.0
let safeAreaInset: CGFloat
if #available(iOS 11.0, *) {
safeAreaInset = self.view.safeAreaInsets.bottom
} else {
safeAreaInset = 0
}
if self.inputBarBottomSpacing.constant == 0{
self.inputBarBottomSpacing.constant -= (endFrame?.size.height ?? 0.0) - safeAreaInset
}
else
{
self.inputBarBottomSpacing.constant = 0
self.inputBarBottomSpacing.constant -= endFrame?.size.height ?? 0.0
self.inputBarBottomSpacing.constant -= (endFrame?.size.height ?? 0.0) - safeAreaInset
}
self.isKeyboardIsShown = true
}
Expand Down

0 comments on commit b91f205

Please sign in to comment.