mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix initial scroll position bug
This commit is contained in:
parent
907925496f
commit
6a810d959b
3 changed files with 8 additions and 6 deletions
|
@ -218,4 +218,4 @@ SPEC CHECKSUMS:
|
||||||
|
|
||||||
PODFILE CHECKSUM: 2fca3f32c171e1324c9e3809b96a32d4a929d05c
|
PODFILE CHECKSUM: 2fca3f32c171e1324c9e3809b96a32d4a929d05c
|
||||||
|
|
||||||
COCOAPODS: 1.10.1
|
COCOAPODS: 1.10.0.rc.1
|
||||||
|
|
|
@ -96,6 +96,7 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
|
||||||
let gifVC = GifPickerViewController(thread: thread)
|
let gifVC = GifPickerViewController(thread: thread)
|
||||||
gifVC.delegate = self
|
gifVC.delegate = self
|
||||||
let navController = OWSNavigationController(rootViewController: gifVC)
|
let navController = OWSNavigationController(rootViewController: gifVC)
|
||||||
|
navController.modalPresentationStyle = .fullScreen
|
||||||
present(navController, animated: true) { }
|
present(navController, animated: true) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// • Tapping replies
|
// • Tapping replies
|
||||||
// • Initial scroll position
|
|
||||||
// • Moderator icons
|
// • Moderator icons
|
||||||
// • Slight paging glitch
|
// • Slight paging glitch
|
||||||
// • Image detail VC transition glitch
|
// • Image detail VC transition glitch
|
||||||
|
@ -27,7 +26,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD
|
||||||
var mentions: [Mention] = []
|
var mentions: [Mention] = []
|
||||||
// Scrolling & paging
|
// Scrolling & paging
|
||||||
private var isUserScrolling = false
|
private var isUserScrolling = false
|
||||||
private var hasPerformedInitialScroll = false
|
private var didFinishInitialLayout = false
|
||||||
private var isLoadingMore = false
|
private var isLoadingMore = false
|
||||||
private var scrollDistanceToBottomBeforeUpdate: CGFloat?
|
private var scrollDistanceToBottomBeforeUpdate: CGFloat?
|
||||||
|
|
||||||
|
@ -132,14 +131,16 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD
|
||||||
|
|
||||||
override func viewDidLayoutSubviews() {
|
override func viewDidLayoutSubviews() {
|
||||||
super.viewDidLayoutSubviews()
|
super.viewDidLayoutSubviews()
|
||||||
if !hasPerformedInitialScroll {
|
if !didFinishInitialLayout {
|
||||||
scrollToBottom(isAnimated: false)
|
DispatchQueue.main.async {
|
||||||
hasPerformedInitialScroll = true
|
self.scrollToBottom(isAnimated: false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidAppear(_ animated: Bool) {
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
didFinishInitialLayout = true
|
||||||
markAllAsRead()
|
markAllAsRead()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue