From 997cd2ef2b70958a6a455add7dedae00876e4c4d Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 29 Aug 2017 11:18:17 -0400 Subject: [PATCH] Revisit the [UIScrollView _adjustContentOffsetIfNecessary] issue. Fix glitches in the initial scroll state in message view. Don't reset scroll state when returning to the message view. // FREEBIE --- .../ConversationView/MessagesViewController.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index f358535be5..aeca846554 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -641,6 +641,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { [self.view layoutSubviews]; + // We want to set the initial scroll state the first time we enter the view. if (!self.viewHasEverAppeared) { [self scrollToDefaultPosition]; } @@ -3514,7 +3515,9 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { { if (self.collectionView.contentSize.height < 1) { // If the collection view hasn't determined its content size yet, - // scroll state is not yet coherent. + // scroll state is not yet coherent. Therefore we can't (and don't + // need to) determine whether we're "scrolled to the bottom" until + // the collection view has determined its content size. return NO; }