keyboard pinning vs iPhoneX

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

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

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

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

@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.view addSubview:self.tableViewController.view]; [self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; [self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self updateTableContents]; [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> #import <UIKit/UIKit.h>
@ -10,12 +10,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges; @property (nonatomic) BOOL shouldIgnoreKeyboardChanges;
// We often want to pin one view to the bottom guide // We often want to pin one view to the bottom of a view controller
// of a view controller BUT adjust its location upward // BUT adjust its location upward if the keyboard appears.
// if the keyboard appears. - (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view;
//
// Use this method in lieu of autoPinToBottomLayoutGuideOfViewController:
- (void)autoPinViewToBottomGuideOrKeyboard:(UIView *)view;
@end @end

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

Loading…
Cancel
Save