|
@@ -115,13 +115,6 @@ class ChatViewController: MessagesViewController {
|
|
selector: #selector(setTextDraft),
|
|
selector: #selector(setTextDraft),
|
|
name: UIApplication.willResignActiveNotification,
|
|
name: UIApplication.willResignActiveNotification,
|
|
object: nil)
|
|
object: nil)
|
|
- notificationCenter.addObserver(self, selector: #selector(rotated),
|
|
|
|
- name: UIDevice.orientationDidChangeNotification,
|
|
|
|
- object: nil)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- deinit {
|
|
|
|
- NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private func startTimer() {
|
|
private func startTimer() {
|
|
@@ -244,7 +237,12 @@ class ChatViewController: MessagesViewController {
|
|
if self.showCustomNavBar, let titleView = self.navigationItem.titleView as? ChatTitleView {
|
|
if self.showCustomNavBar, let titleView = self.navigationItem.titleView as? ChatTitleView {
|
|
titleView.hideLocationStreamingIndicator() }},
|
|
titleView.hideLocationStreamingIndicator() }},
|
|
completion: { (_) -> Void in
|
|
completion: { (_) -> Void in
|
|
- self.updateTitle(chat: DcChat(id: self.chatId)) })
|
|
|
|
|
|
+ self.updateTitle(chat: DcChat(id: self.chatId))
|
|
|
|
+ self.messagesCollectionView.reloadDataAndKeepOffset()
|
|
|
|
+ if self.isLastSectionVisible() {
|
|
|
|
+ self.messagesCollectionView.scrollToBottom(animated: true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -389,13 +387,6 @@ class ChatViewController: MessagesViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @objc private func rotated() {
|
|
|
|
- self.messagesCollectionView.reloadDataAndKeepOffset()
|
|
|
|
- if self.isLastSectionVisible() {
|
|
|
|
- self.messagesCollectionView.scrollToBottom(animated: true)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private func configureMessageMenu() {
|
|
private func configureMessageMenu() {
|
|
var menuItems: [UIMenuItem]
|
|
var menuItems: [UIMenuItem]
|
|
|
|
|