From 0c0180264edc55f81b2440dbee19096b1dafdb72 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 25 Feb 2023 15:30:30 -0500 Subject: [PATCH] Fix no content message incorrectly appearing on profiles Caused by a spurious appearance transition from embedChild --- Tusker/Screens/Profile/ProfileViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Profile/ProfileViewController.swift b/Tusker/Screens/Profile/ProfileViewController.swift index 4872595b..bdfd765b 100644 --- a/Tusker/Screens/Profile/ProfileViewController.swift +++ b/Tusker/Screens/Profile/ProfileViewController.swift @@ -161,7 +161,15 @@ class ProfileViewController: UIViewController, StateRestorableViewController { // if old doesn't exist, we're selecting the initial view controller, so moving the header around isn't necessary new.initialHeaderMode = .createView new.view.translatesAutoresizingMaskIntoConstraints = false - embedChild(new) + addChild(new) + view.addSubview(new.view) + NSLayoutConstraint.activate([ + new.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + new.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + new.view.topAnchor.constraint(equalTo: view.topAnchor), + new.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + ]) + new.didMove(toParent: self) self.currentIndex = index state = .idle completion?(true)