From 23014f9ea47e456c30d315bbf14df0d652ffecca Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 8 Dec 2017 11:40:59 -0500 Subject: [PATCH] Keep header affixed to navbar. // FREEBIE --- .../contacts/SelectThreadViewController.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/SignalMessaging/contacts/SelectThreadViewController.m b/SignalMessaging/contacts/SelectThreadViewController.m index 1b05f3c6a..0542615f9 100644 --- a/SignalMessaging/contacts/SelectThreadViewController.m +++ b/SignalMessaging/contacts/SelectThreadViewController.m @@ -83,18 +83,22 @@ NS_ASSUME_NONNULL_BEGIN [searchBar sizeToFit]; UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar]; + if (!header) { + header = searchBar; + } + [self.view addSubview:header]; + [header autoPinWidthToSuperview]; + [header autoPinToTopLayoutGuideOfViewController:self withInset:0]; + [header setCompressionResistanceVerticalHigh]; + [header setContentHuggingVerticalHigh]; // Table _tableViewController = [OWSTableViewController new]; _tableViewController.delegate = self; [self.view addSubview:self.tableViewController.view]; [_tableViewController.view autoPinWidthToSuperview]; - [_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0]; - if (header) { - _tableViewController.tableView.tableHeaderView = header; - } else { - _tableViewController.tableView.tableHeaderView = searchBar; - } + [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:header]; + [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view]; }