mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Added listener for keyboard input mode changes (e.g. emoji keyboard)
This commit is contained in:
@@ -69,6 +69,20 @@ extension MessagesViewController {
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
||||
NotificationCenter.default
|
||||
.publisher(for: UITextInputMode.currentInputModeDidChangeNotification)
|
||||
.subscribe(on: DispatchQueue.global())
|
||||
.receive(on: DispatchQueue.main)
|
||||
.removeDuplicates()
|
||||
.sink { [weak self] _ in
|
||||
self?.updateMessageCollectionViewBottomInset()
|
||||
|
||||
if !(self?.maintainPositionOnInputBarHeightChanged ?? false) {
|
||||
self?.messagesCollectionView.scrollToLastItem()
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
||||
/// Observe frame change of the input bar container to update collectioView bottom inset
|
||||
inputContainerView.publisher(for: \.center)
|
||||
.receive(on: DispatchQueue.main)
|
||||
|
||||
Reference in New Issue
Block a user