mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
fix quote view show without tableview scrolling
This commit is contained in:
parent
1335defc5c
commit
f6fb8f27de
1 changed files with 4 additions and 5 deletions
|
@ -286,6 +286,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func handleKeyboardWillShowNotification(_ notification: Notification) {
|
@objc func handleKeyboardWillShowNotification(_ notification: Notification) {
|
||||||
|
print("Ryan: handleKeyboardWillShowNotification")
|
||||||
guard let newHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size.height else { return }
|
guard let newHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size.height else { return }
|
||||||
if (newHeight > initialKeyboardHeight && initialKeyboardHeight == 0) {
|
if (newHeight > initialKeyboardHeight && initialKeyboardHeight == 0) {
|
||||||
initialKeyboardHeight = newHeight
|
initialKeyboardHeight = newHeight
|
||||||
|
@ -296,12 +297,10 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
||||||
scrollButton.pin(.bottom, to: .bottom, of: view, withInset: -(newHeight + 16)) // + 16 to match the bottom inset of the table view
|
scrollButton.pin(.bottom, to: .bottom, of: view, withInset: -(newHeight + 16)) // + 16 to match the bottom inset of the table view
|
||||||
didConstrainScrollButton = true
|
didConstrainScrollButton = true
|
||||||
}
|
}
|
||||||
let shouldScroll = (newHeight > 200) // Arbitrary value that's higher than the collapsed size and lower than the expanded size
|
// let shouldScroll = (newHeight > 200) // Arbitrary value that's higher than the collapsed size and lower than the expanded size
|
||||||
let newContentOffsetY = self.messagesTableView.contentOffset.y + newHeight - self.messagesTableView.keyboardHeight
|
let newContentOffsetY = self.messagesTableView.contentOffset.y + newHeight - self.messagesTableView.keyboardHeight
|
||||||
if shouldScroll {
|
self.messagesTableView.contentOffset.y = newContentOffsetY
|
||||||
self.messagesTableView.contentOffset.y = newContentOffsetY
|
self.messagesTableView.keyboardHeight = newHeight
|
||||||
self.messagesTableView.keyboardHeight = newHeight
|
|
||||||
}
|
|
||||||
self.scrollButton.alpha = 0
|
self.scrollButton.alpha = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue