Skip to content

Commit

Permalink
Merge pull request #1821 from Almaz5200/main
Browse files Browse the repository at this point in the history
Added ability to specify additionalBottomSpace for keyboardManager
  • Loading branch information
Kaspik committed Feb 21, 2024
2 parents 9c23309 + 8d14735 commit 43f8ec3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Controllers/MessagesViewController+Keyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ extension MessagesViewController {
// MARK: - Register Observers

internal func addKeyboardObservers() {
keyboardManager.bind(inputAccessoryView: inputContainerView)
keyboardManager.bind(
inputAccessoryView: inputContainerView,
withAdditionalBottomSpace: { [weak self] in self?.inputBarAdditionalBottomSpace() ?? 0 }
)
keyboardManager.bind(to: messagesCollectionView)

/// Observe didBeginEditing to scroll content to last item if necessary
Expand Down
5 changes: 5 additions & 0 deletions Sources/Controllers/MessagesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ open class MessagesViewController: UIViewController, UICollectionViewDelegateFlo
}
}

/// withAdditionalBottomSpace parameter for InputBarAccessoryView's KeyboardManager
open func inputBarAdditionalBottomSpace() -> CGFloat {
0
}

open override func viewDidLoad() {
super.viewDidLoad()
setupDefaults()
Expand Down

0 comments on commit 43f8ec3

Please sign in to comment.