From a27ee19f4eabc1061828e9baf561682d9fa520d4 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 2 Jul 2018 23:33:55 -0600 Subject: [PATCH] Fix scroll offset for iPhoneX now that content is behind toolbar --- .../ConversationView/ConversationViewController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 2677f4e39..98c3af041 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -4262,8 +4262,11 @@ typedef enum : NSUInteger { CGFloat contentHeight = self.safeContentHeight; - CGFloat dstY - = MAX(0, contentHeight + self.collectionView.contentInset.bottom - self.collectionView.bounds.size.height); + // bottomLayoutGuide accounts for extra offset needed on iPhoneX + + CGFloat dstY = MAX(0, + contentHeight + self.collectionView.contentInset.bottom + self.bottomLayoutGuide.length + - self.collectionView.bounds.size.height); [self.collectionView setContentOffset:CGPointMake(0, dstY) animated:NO]; [self didScrollToBottom];