keyboard pinning vs iPhoneX

pull/1/head
Michael Kirk 6 years ago
parent af5f549e49
commit 86553b62f9

@ -188,7 +188,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
bottomBanner.autoPinEdge(toSuperviewEdge: .top)
bottomBanner.autoPinWidthToSuperview()
self.autoPinView(toBottomGuideOrKeyboard: bottomBanner)
self.autoPinView(toBottomOfViewControllerOrKeyboard: bottomBanner)
// The Giphy API requires us to "show their trademark prominently" in our GIF experience.
let logoImage = UIImage(named: "giphy_logo")

@ -125,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN
[_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:contactsPermissionReminderView];
[self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
_tableViewController.tableView.tableHeaderView = searchBar;
_noSignalContactsView = [self createNoSignalContactsView];

@ -124,7 +124,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self updateTableContents];
}

@ -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];
[self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self updateTableContents];
}

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
@ -10,12 +10,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges;
// We often want to pin one view to the bottom guide
// of a view controller BUT adjust its location upward
// if the keyboard appears.
//
// Use this method in lieu of autoPinToBottomLayoutGuideOfViewController:
- (void)autoPinViewToBottomGuideOrKeyboard:(UIView *)view;
// We often want to pin one view to the bottom of a view controller
// BUT adjust its location upward if the keyboard appears.
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view;
@end

@ -2,8 +2,8 @@
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
#import "UIView+OWS.h"
#import <SignalMessaging/OWSViewController.h>
NS_ASSUME_NONNULL_BEGIN
@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)autoPinViewToBottomGuideOrKeyboard:(UIView *)view
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view
{
OWSAssert(view);
OWSAssert(!self.bottomLayoutConstraint);
@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
object:nil];
self.bottomLayoutView = view;
self.bottomLayoutConstraint = [view autoPinToBottomLayoutGuideOfViewController:self withInset:0];
self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view];
}
- (void)keyboardWillShow:(NSNotification *)notification

Loading…
Cancel
Save