From cea93784b1de46f23ade5b0b1e418d401ab2b719 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 16:30:13 -0400 Subject: [PATCH] Avoid redundant content inset updates. --- .../ConversationView/ConversationViewController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 70e892763..70b908d55 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -4164,7 +4164,9 @@ typedef enum : NSUInteger { BOOL wasScrolledToBottom = [self isScrolledToBottom]; void (^adjustInsets)(void) = ^(void) { - self.collectionView.contentInset = newInsets; + if (!UIEdgeInsetsEqualToEdgeInsets(self.collectionView.contentInset, newInsets)) { + self.collectionView.contentInset = newInsets; + } self.collectionView.scrollIndicatorInsets = newInsets; // Note there is a bug in iOS11.2 which where switching to the emoji keyboard