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)