From 460f160cbb7044b0ce98eed3bc0545e655729762 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 8 Jan 2019 10:44:22 -0500 Subject: [PATCH] Landscape orientation. --- Signal/Signal-Info.plist | 2 ++ .../DomainFrontingCountryViewController.m | 5 +-- .../ConversationHeaderView.swift | 3 +- .../ConversationViewController.m | 31 +++++++++++++++++++ .../HomeView/HomeViewController.m | 6 ++-- .../NewContactThreadViewController.m | 5 +-- .../ViewControllers/NewGroupViewController.m | 5 +-- .../OWS2FARegistrationViewController.m | 9 +++++- .../OWS2FASettingsViewController.m | 17 ++++++---- .../ViewControllers/ProfileViewController.m | 10 +++++- .../BackupRestoreViewController.swift | 8 ++++- .../CodeVerificationViewController.m | 9 +++++- .../Registration/RegistrationViewController.m | 10 +++++- .../UpdateGroupViewController.m | 5 +-- .../CountryCodeViewController.h | 4 ++- .../CountryCodeViewController.m | 10 +++++- .../ViewControllers/OWSNavigationController.m | 8 +++-- .../ViewControllers/OWSTableViewController.m | 5 +-- .../ViewControllers/OWSViewController.m | 4 +-- .../SelectRecipientViewController.m | 5 +-- .../SelectThreadViewController.m | 5 +-- 21 files changed, 132 insertions(+), 34 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 02c73bf87..815217087 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -148,6 +148,8 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance diff --git a/Signal/src/ViewControllers/AppSettings/DomainFrontingCountryViewController.m b/Signal/src/ViewControllers/AppSettings/DomainFrontingCountryViewController.m index 6c49443cb..1b96296ad 100644 --- a/Signal/src/ViewControllers/AppSettings/DomainFrontingCountryViewController.m +++ b/Signal/src/ViewControllers/AppSettings/DomainFrontingCountryViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "DomainFrontingCountryViewController.h" @@ -41,7 +41,8 @@ NS_ASSUME_NONNULL_BEGIN { _tableViewController = [OWSTableViewController new]; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0]; [_tableViewController.view autoPinToBottomLayoutGuideOfViewController:self withInset:0]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift index 13826c4c5..76b0acb22 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // import Foundation @@ -32,6 +32,7 @@ public class ConversationHeaderView: UIStackView { } set { self.subtitleLabel.attributedText = newValue + self.subtitleLabel.isHidden = newValue == nil } } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 04bffc62f..88a368eb1 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1457,6 +1457,12 @@ typedef enum : NSUInteger { - (void)updateNavigationBarSubtitleLabel { + BOOL hasCompactHeader = self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact; + if (hasCompactHeader) { + self.headerView.attributedSubtitle = nil; + return; + } + NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; UIColor *subtitleColor = [Theme.navbarTitleColor colorWithAlphaComponent:(CGFloat)0.9]; @@ -4747,6 +4753,31 @@ typedef enum : NSUInteger { [self scrollToBottomAnimated:NO]; } +#pragma mark - Orientation + +- (void)viewWillTransitionToSize:(CGSize)size + withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + + self.conversationStyle.viewWidth = size.width; + + for (id viewItem in self.viewItems) { + [viewItem clearCachedLayoutState]; + } + + [self resetContentAndLayout]; + + // TODO: Ensure scroll state continuity? +} + +- (void)traitCollectionDidChange:(nullable UITraitCollection *)previousTraitCollection +{ + [super traitCollectionDidChange:previousTraitCollection]; + + [self updateNavigationBarSubtitleLabel]; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 586ef500e..70f330944 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "HomeViewController.h" @@ -427,7 +427,9 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations self.searchResultsController = searchResultsController; [self addChildViewController:searchResultsController]; [self.view addSubview:searchResultsController.view]; - [searchResultsController.view autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsZero excludingEdge:ALEdgeTop]; + [searchResultsController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [searchResultsController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [searchResultsController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; if (@available(iOS 11, *)) { [searchResultsController.view autoPinTopToSuperviewMarginWithInset:56]; } else { diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index 0bcd0c927..340e59dde 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "NewContactThreadViewController.h" @@ -112,7 +112,8 @@ NS_ASSUME_NONNULL_BEGIN [self addChildViewController:self.tableViewController]; [self.view insertSubview:self.tableViewController.view atIndex:0]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeTop]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/Signal/src/ViewControllers/NewGroupViewController.m b/Signal/src/ViewControllers/NewGroupViewController.m index 9ceea7ea0..258fd631a 100644 --- a/Signal/src/ViewControllers/NewGroupViewController.m +++ b/Signal/src/ViewControllers/NewGroupViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "NewGroupViewController.h" @@ -126,7 +126,8 @@ NS_ASSUME_NONNULL_BEGIN _tableViewController = [OWSTableViewController new]; _tableViewController.delegate = self; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/Signal/src/ViewControllers/OWS2FARegistrationViewController.m b/Signal/src/ViewControllers/OWS2FARegistrationViewController.m index 48a641be1..8b285eb31 100644 --- a/Signal/src/ViewControllers/OWS2FARegistrationViewController.m +++ b/Signal/src/ViewControllers/OWS2FARegistrationViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWS2FARegistrationViewController.h" @@ -149,6 +149,13 @@ NS_ASSUME_NONNULL_BEGIN [RegistrationController verificationWasCompletedFromView:self]; } +#pragma mark - Orientation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskPortrait; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/OWS2FASettingsViewController.m b/Signal/src/ViewControllers/OWS2FASettingsViewController.m index 26314b8d2..5a8dbd6e5 100644 --- a/Signal/src/ViewControllers/OWS2FASettingsViewController.m +++ b/Signal/src/ViewControllers/OWS2FASettingsViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWS2FASettingsViewController.h" @@ -148,9 +148,11 @@ NS_ASSUME_NONNULL_BEGIN [self createTableView]; [instructionsLabel autoPinToTopLayoutGuideOfViewController:self withInset:kVSpacing]; - [instructionsLabel autoPinWidthToSuperviewWithMargin:self.hMargin]; + [instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin]; + [instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin]; - [self.tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [self.tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:instructionsLabel @@ -187,16 +189,19 @@ NS_ASSUME_NONNULL_BEGIN [self createPinTextfield]; [instructionsLabel autoPinTopToSuperviewMarginWithInset:kVSpacing]; - [instructionsLabel autoPinWidthToSuperviewWithMargin:self.hMargin]; + [instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin]; + [instructionsLabel autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin]; [self.pinTextfield autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:instructionsLabel withOffset:kVSpacing]; - [self.pinTextfield autoPinWidthToSuperviewWithMargin:self.hMargin]; + [self.pinTextfield autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin]; + [self.pinTextfield autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin]; UIView *underscoreView = [UIView new]; underscoreView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:1.f]; [self.view addSubview:underscoreView]; [underscoreView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.pinTextfield withOffset:3]; - [underscoreView autoPinWidthToSuperviewWithMargin:self.hMargin]; + [underscoreView autoPinEdgeToSuperviewSafeArea:ALEdgeLeading withInset:self.hMargin]; + [underscoreView autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing withInset:self.hMargin]; [underscoreView autoSetDimension:ALDimensionHeight toSize:1.f]; [self updateNavigationItems]; diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index f2a37c374..9a18d755b 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "ProfileViewController.h" @@ -619,6 +619,14 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat return result; } +#pragma mark - Orientation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return (self.profileViewMode == ProfileViewMode_Registration ? UIInterfaceOrientationMaskPortrait + : UIInterfaceOrientationMaskAllButUpsideDown); +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/Registration/BackupRestoreViewController.swift b/Signal/src/ViewControllers/Registration/BackupRestoreViewController.swift index 604e92ed7..7547704b0 100644 --- a/Signal/src/ViewControllers/Registration/BackupRestoreViewController.swift +++ b/Signal/src/ViewControllers/Registration/BackupRestoreViewController.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // import UIKit @@ -166,4 +166,10 @@ public class BackupRestoreViewController: OWSTableViewController { updateTableContents() } } + + // MARK: Orientation + + public override var supportedInterfaceOrientations: UIInterfaceOrientationMask { + return .allButUpsideDown + } } diff --git a/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m b/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m index 3ff1e39f4..3a168ebd5 100644 --- a/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m +++ b/Signal/src/ViewControllers/Registration/CodeVerificationViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "CodeVerificationViewController.h" @@ -497,6 +497,13 @@ NS_ASSUME_NONNULL_BEGIN return UIStatusBarStyleLightContent; } +#pragma mark - Orientation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskPortrait; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/Registration/RegistrationViewController.m b/Signal/src/ViewControllers/Registration/RegistrationViewController.m index e7fc7c142..a1aa2b43e 100644 --- a/Signal/src/ViewControllers/Registration/RegistrationViewController.m +++ b/Signal/src/ViewControllers/Registration/RegistrationViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "RegistrationViewController.h" @@ -502,6 +502,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi { CountryCodeViewController *countryCodeController = [CountryCodeViewController new]; countryCodeController.countryCodeDelegate = self; + countryCodeController.interfaceOrientationMask = UIInterfaceOrientationMaskPortrait; OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:countryCodeController]; [self presentViewController:navigationController animated:YES completion:nil]; @@ -629,6 +630,13 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi return UIStatusBarStyleLightContent; } +#pragma mark - Orientation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskPortrait; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m b/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m index bdb532bd3..1820ad17c 100644 --- a/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/UpdateGroupViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "UpdateGroupViewController.h" @@ -119,7 +119,8 @@ NS_ASSUME_NONNULL_BEGIN _tableViewController = [OWSTableViewController new]; _tableViewController.delegate = self; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/SignalMessaging/ViewControllers/CountryCodeViewController.h b/SignalMessaging/ViewControllers/CountryCodeViewController.h index 525db4f9b..deb98c044 100644 --- a/SignalMessaging/ViewControllers/CountryCodeViewController.h +++ b/SignalMessaging/ViewControllers/CountryCodeViewController.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWSTableViewController.h" @@ -23,4 +23,6 @@ @property (nonatomic) BOOL isPresentedInNavigationController; +@property (nonatomic) UIInterfaceOrientationMask interfaceOrientationMask; + @end diff --git a/SignalMessaging/ViewControllers/CountryCodeViewController.m b/SignalMessaging/ViewControllers/CountryCodeViewController.m index e63c62469..4d83e0098 100644 --- a/SignalMessaging/ViewControllers/CountryCodeViewController.m +++ b/SignalMessaging/ViewControllers/CountryCodeViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "CountryCodeViewController.h" @@ -28,6 +28,7 @@ [super loadView]; self.shouldUseTheme = NO; + self.interfaceOrientationMask = UIInterfaceOrientationMaskAllButUpsideDown; self.view.backgroundColor = [UIColor whiteColor]; self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @""); @@ -161,4 +162,11 @@ [self.searchBar resignFirstResponder]; } +#pragma mark - Orientation + +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +{ + return self.interfaceOrientationMask; +} + @end diff --git a/SignalMessaging/ViewControllers/OWSNavigationController.m b/SignalMessaging/ViewControllers/OWSNavigationController.m index 6958c4c22..a9bd8230e 100644 --- a/SignalMessaging/ViewControllers/OWSNavigationController.m +++ b/SignalMessaging/ViewControllers/OWSNavigationController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWSNavigationController.h" @@ -199,7 +199,11 @@ NS_ASSUME_NONNULL_BEGIN - (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; + if (self.topViewController) { + return self.topViewController.supportedInterfaceOrientations; + } else { + return UIInterfaceOrientationMaskPortrait; + } } @end diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.m b/SignalMessaging/ViewControllers/OWSTableViewController.m index 99291855d..2b7c7a882 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.m +++ b/SignalMessaging/ViewControllers/OWSTableViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWSTableViewController.h" @@ -492,7 +492,8 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier"; // won't adjust our content insets. [self.tableView autoPinToTopLayoutGuideOfViewController:self withInset:0]; [self.tableView autoPinToBottomLayoutGuideOfViewController:self withInset:0]; - [self.tableView autoPinWidthToSuperview]; + [self.tableView autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableView autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; // We don't need a top or bottom insets, since we pin to the top and bottom layout guides. self.automaticallyAdjustsScrollViewInsets = NO; diff --git a/SignalMessaging/ViewControllers/OWSViewController.m b/SignalMessaging/ViewControllers/OWSViewController.m index 8ed439d0a..5bc88b39b 100644 --- a/SignalMessaging/ViewControllers/OWSViewController.m +++ b/SignalMessaging/ViewControllers/OWSViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "OWSViewController.h" @@ -181,7 +181,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; + return UIInterfaceOrientationMaskAllButUpsideDown; } @end diff --git a/SignalMessaging/ViewControllers/SelectRecipientViewController.m b/SignalMessaging/ViewControllers/SelectRecipientViewController.m index b8d0e7a98..01c06b2ce 100644 --- a/SignalMessaging/ViewControllers/SelectRecipientViewController.m +++ b/SignalMessaging/ViewControllers/SelectRecipientViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "SelectRecipientViewController.h" @@ -90,7 +90,8 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien _tableViewController = [OWSTableViewController new]; _tableViewController.delegate = self; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0]; [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index 7e442184c..cbf67ae66 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // #import "SelectThreadViewController.h" @@ -107,7 +107,8 @@ NS_ASSUME_NONNULL_BEGIN _tableViewController = [OWSTableViewController new]; _tableViewController.delegate = self; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeLeading]; + [self.tableViewController.view autoPinEdgeToSuperviewSafeArea:ALEdgeTrailing]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:header]; [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;