Respond to CR.
This commit is contained in:
parent
eb400114c2
commit
644e78f19d
|
@ -46,13 +46,7 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
|
|||
self.tableView.rowHeight = UITableViewAutomaticDimension;
|
||||
self.tableView.estimatedRowHeight = 70;
|
||||
|
||||
// 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.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
[self.tableView applyScrollViewInsetsFix];
|
||||
|
||||
self.dbConnection = [[OWSPrimaryStorage sharedManager] newDatabaseConnection];
|
||||
[self.dbConnection beginLongLivedReadTransaction];
|
||||
|
|
|
@ -521,13 +521,7 @@ typedef enum : NSUInteger {
|
|||
[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
|
||||
}
|
||||
[self.collectionView applyScrollViewInsetsFix];
|
||||
|
||||
_inputToolbar = [ConversationInputToolbar new];
|
||||
self.inputToolbar.inputToolbarDelegate = self;
|
||||
|
|
|
@ -216,7 +216,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
|
||||
|
||||
if (@available(iOS 11.0, *)) {
|
||||
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
[scrollView contentInsetAdjustmentBehavior];
|
||||
} else {
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
}
|
||||
|
|
|
@ -146,6 +146,8 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
|
|||
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
||||
]
|
||||
} else {
|
||||
scrollView.applyInsetsFix()
|
||||
|
||||
scrollView.autoPinEdge(toSuperviewEdge: .bottom)
|
||||
}
|
||||
|
||||
|
|
|
@ -452,13 +452,9 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
|||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
// 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.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
[self.tableView applyScrollViewInsetsFix];
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView autoPinWidthToSuperview];
|
||||
[self.tableView autoPinToTopLayoutGuideOfViewController:self withInset:0];
|
||||
|
|
|
@ -125,6 +125,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value);
|
|||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@interface UIScrollView (OWS)
|
||||
|
||||
- (void)applyScrollViewInsetsFix;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Macros
|
||||
|
||||
CG_INLINE CGSize CGSizeCeil(CGSize size)
|
||||
|
|
|
@ -487,4 +487,21 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation UIScrollView (OWS)
|
||||
|
||||
- (void)applyScrollViewInsetsFix
|
||||
{
|
||||
// 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.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
Loading…
Reference in New Issue