Fix scroll state insets in conversation view.

This commit is contained in:
Matthew Chen 2017-11-20 16:01:59 -05:00 committed by Michael Kirk
parent 28fe073c5e
commit aea2bf3e00

View File

@ -504,6 +504,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
[self.collectionView autoPinWidthToSuperview];
[self.collectionView autoPinToTopLayoutGuideOfViewController:self withInset:0];
// Fix a bug that only affects iOS 11.0.x and 11.1.x.
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0) && !SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 2)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
#pragma clang diagnostic pop
}
_inputToolbar = [ConversationInputToolbar new];
self.inputToolbar.inputToolbarDelegate = self;
self.inputToolbar.inputTextViewDelegate = self;