diff --git a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift index 0ce0b91a5..b7dfa5fc8 100644 --- a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift +++ b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift @@ -173,7 +173,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect self.view.addSubview(bottomBanner) bottomBanner.autoPinWidthToSuperview() bottomBanner.autoPinEdge(.top, to: .bottom, of: self.collectionView) - bottomBanner.autoPin(toBottomLayoutGuideOf: self, withInset: 0) + self.autoPinView(toBottomGuideOrKeyboard:bottomBanner) // The Giphy API requires us to "show their trademark prominently" in our GIF experience. let logoImage = UIImage(named: "giphy_logo") @@ -187,14 +187,14 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect self.noResultsView = noResultsView self.view.addSubview(noResultsView) noResultsView.autoPinWidthToSuperview(withMargin: 20) - noResultsView.autoVCenterInSuperview() + noResultsView.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView) let searchErrorView = createErrorLabel(text: NSLocalizedString("GIF_VIEW_SEARCH_ERROR", comment: "Indicates that an error occured while searching.")) self.searchErrorView = searchErrorView self.view.addSubview(searchErrorView) searchErrorView.autoPinWidthToSuperview(withMargin: 20) - searchErrorView.autoVCenterInSuperview() + searchErrorView.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView) searchErrorView.isUserInteractionEnabled = true searchErrorView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(retryTapped))) @@ -202,7 +202,8 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) self.activityIndicator = activityIndicator self.view.addSubview(activityIndicator) - activityIndicator.autoCenterInSuperview() + activityIndicator.autoHCenterInSuperview() + activityIndicator.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView) self.updateContents() } diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index 8bc1fa110..db580df2f 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN [_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:contactsPermissionReminderView]; - [_tableViewController.view autoPinToBottomLayoutGuideOfViewController:self withInset:0]; + [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; _tableViewController.tableView.tableHeaderView = searchBar; _noSignalContactsView = [self createNoSignalContactsView]; diff --git a/Signal/src/ViewControllers/NewGroupViewController.m b/Signal/src/ViewControllers/NewGroupViewController.m index 9ff7b3729..a43ca3df1 100644 --- a/Signal/src/ViewControllers/NewGroupViewController.m +++ b/Signal/src/ViewControllers/NewGroupViewController.m @@ -123,7 +123,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68; [self.view addSubview:self.tableViewController.view]; [_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; - [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; [self updateTableContents]; } diff --git a/Signal/src/ViewControllers/SelectThreadViewController.m b/Signal/src/ViewControllers/SelectThreadViewController.m index a16fb5df5..dbcd5d22a 100644 --- a/Signal/src/ViewControllers/SelectThreadViewController.m +++ b/Signal/src/ViewControllers/SelectThreadViewController.m @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN } else { _tableViewController.tableView.tableHeaderView = searchBar; } - [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; } #pragma mark - UISearchBarDelegate diff --git a/Signal/src/ViewControllers/UpdateGroupViewController.m b/Signal/src/ViewControllers/UpdateGroupViewController.m index 63471c2d0..6706193fb 100644 --- a/Signal/src/ViewControllers/UpdateGroupViewController.m +++ b/Signal/src/ViewControllers/UpdateGroupViewController.m @@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN [self.view addSubview:self.tableViewController.view]; [_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; - [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; [self updateTableContents]; }