Skip to content

Commit

Permalink
Respect safe area for "Reply to post" section on the Comments screen (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
justtwago committed Feb 21, 2024
2 parents 983d13e + d5e6dde commit 730306f
Showing 1 changed file with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ - (void)configureKeyboardGestureRecognizer

- (void)configureKeyboardManager
{
// The variable introduced because we cannot reuse the same constraint for the keyboard manager and the reply text view.
self.replyTextViewBottomConstraint = [self.view.keyboardLayoutGuide.topAnchor constraintEqualToAnchor:self.replyTextView.bottomAnchor];
self.keyboardManager = [[KeyboardDismissHelper alloc] initWithParentView:self.view
scrollView:self.tableView
dismissableControl:self.replyTextView
Expand Down Expand Up @@ -401,20 +403,11 @@ - (void)configureViewConstraints
metrics:nil
views:views]];

// ReplyTextView Constraints
[[self.replyTextView.leftAnchor constraintEqualToAnchor:self.tableView.leftAnchor] setActive:YES];
[[self.replyTextView.rightAnchor constraintEqualToAnchor:self.tableView.rightAnchor] setActive:YES];

self.replyTextViewBottomConstraint = [NSLayoutConstraint constraintWithItem:self.view
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.replyTextView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:0.0];
self.replyTextViewBottomConstraint.priority = UILayoutPriorityDefaultHigh;

[self.view addConstraint:self.replyTextViewBottomConstraint];
[NSLayoutConstraint activateConstraints:@[
[self.replyTextView.leadingAnchor constraintEqualToAnchor:self.replyTextView.leadingAnchor],
[self.replyTextView.trailingAnchor constraintEqualToAnchor:self.replyTextView.trailingAnchor],
[self.view.keyboardLayoutGuide.topAnchor constraintEqualToAnchor:self.replyTextView.bottomAnchor]
]];

// Suggestions Constraints
// Pin the suggestions view left and right edges to the reply view edges
Expand Down

0 comments on commit 730306f

Please sign in to comment.