diff --git a/Signal/src/ViewControllers/GetStartedBannerViewController.swift b/Signal/src/ViewControllers/GetStartedBannerViewController.swift index ecfae68e8ac..847fcc603e3 100644 --- a/Signal/src/ViewControllers/GetStartedBannerViewController.swift +++ b/Signal/src/ViewControllers/GetStartedBannerViewController.swift @@ -111,11 +111,11 @@ class GetStartedBannerViewController: UIViewController, UICollectionViewDelegate header.autoPinEdge(toSuperviewMargin: .trailing, relation: .lessThanOrEqual) header.autoPinEdge(.top, to: .top, of: opaqueBackdrop, withOffset: 8) - collectionView.preservesSuperviewLayoutMargins = true collectionView.autoSetDimension(.height, toSize: 180) collectionView.autoPinEdge(.top, to: .bottom, of: header, withOffset: 12) collectionView.autoPinWidthToSuperview() collectionView.autoPinBottomToSuperviewMargin() + collectionView.layoutMargins = UIEdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16) collectionView.clipsToBounds = false self.view = view diff --git a/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController.swift b/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController.swift index 114d6a03fb0..4c7e662b005 100644 --- a/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController.swift +++ b/Signal/src/ViewControllers/HomeView/Chat List/ChatListViewController.swift @@ -72,14 +72,16 @@ public class ChatListViewController: OWSViewController, HomeTabViewController { emptyInboxView.autoAlignAxis(.horizontal, toSameAxisOf: view, withMultiplier: 0.85) // First Conversation Cue - view.addSubview(firstConversationCueView) - firstConversationCueView.autoPin(toTopLayoutGuideOf: self, withInset: 0) - // This inset bakes in assumptions about UINavigationBar layout, but I'm not sure - // there's a better way to do it, since it isn't safe to use iOS auto layout with - // UINavigationBar contents. - firstConversationCueView.autoPinEdge(toSuperviewEdge: .trailing, withInset: 6) - firstConversationCueView.autoPinEdge(toSuperviewEdge: .leading, withInset: 10, relation: .greaterThanOrEqual) - firstConversationCueView.autoPinEdge(toSuperviewMargin: .bottom, relation: .greaterThanOrEqual) + if let navigationController = self.navigationController { + navigationController.view.addSubview(firstConversationCueView) + + // This inset bakes in assumptions about UINavigationBar layout, but I'm not sure + // if there's a better way to do it, since it isn't safe to use iOS auto layout with + // UINavigationBar contents. + firstConversationCueView.autoPinEdge(toSuperviewMargin: .top, withInset: 35) + firstConversationCueView.autoPinEdge(toSuperviewEdge: .trailing, withInset: 6) + firstConversationCueView.autoPinEdge(toSuperviewEdge: .leading, withInset: 10, relation: .greaterThanOrEqual) + } // Search navigationItem.searchController = viewState.searchController @@ -240,6 +242,7 @@ public class ChatListViewController: OWSViewController, HomeTabViewController { super.viewWillDisappear(animated) isViewVisible = false + firstConversationCueView.isHidden = true searchResultsController.viewWillDisappear(animated) }