Merge branch 'charlesmchen/profileViewsVsKeyboard' into release/5.3.0
This commit is contained in:
commit
fcfaa1fa05
@ -43,6 +43,8 @@ class ProfileBioViewController: OWSTableViewController {
|
||||
|
||||
self.bioTextField.text = bio
|
||||
self.bioEmojiLabel.text = bioEmoji
|
||||
|
||||
self.shouldAvoidKeyboard = true
|
||||
}
|
||||
|
||||
// MARK: - Orientation
|
||||
|
||||
@ -73,6 +73,8 @@ public class ProfileViewController: OWSTableViewController {
|
||||
self.completionHandler = completionHandler
|
||||
|
||||
super.init()
|
||||
|
||||
self.shouldAvoidKeyboard = true
|
||||
}
|
||||
|
||||
// MARK: - Orientation
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020 Open Whisper Systems. All rights reserved.
|
||||
// Copyright (c) 2021 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <SignalMessaging/OWSViewController.h>
|
||||
@ -195,6 +195,8 @@ typedef BOOL (^OWSTableSwitchBlock)(void);
|
||||
|
||||
@property (nonatomic, nullable) UIColor *customSectionHeaderFooterBackgroundColor;
|
||||
|
||||
@property (nonatomic) BOOL shouldAvoidKeyboard;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
#pragma mark - Presentation
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020 Open Whisper Systems. All rights reserved.
|
||||
// Copyright (c) 2021 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSTableViewController.h"
|
||||
@ -607,7 +607,12 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||
// We don't need a top or bottom insets, since we pin to the top and bottom layout guides.
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
} else {
|
||||
[self.tableView autoPinEdgesToSuperviewEdges];
|
||||
if (self.shouldAvoidKeyboard) {
|
||||
[self.tableView autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsZero excludingEdge:ALEdgeBottom];
|
||||
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableView avoidNotch:YES];
|
||||
} else {
|
||||
[self.tableView autoPinEdgesToSuperviewEdges];
|
||||
}
|
||||
}
|
||||
|
||||
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kOWSTableCellIdentifier];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user