diff --git a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift index 39ed714d..06fc4ce2 100644 --- a/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift +++ b/Mastodon/Scene/Onboarding/PickServer/MastodonPickServerViewController.swift @@ -84,15 +84,6 @@ extension MastodonPickServerViewController { nextStepButton.heightAnchor.constraint(equalToConstant: MastodonPickServerViewController.actionButtonHeight).priority(.defaultHigh), view.layoutMarginsGuide.bottomAnchor.constraint(equalTo: nextStepButton.bottomAnchor, constant: WelcomeViewController.viewBottomPaddingHeight), ]) - - emptyStateView.translatesAutoresizingMaskIntoConstraints = false - view.addSubview(emptyStateView) - NSLayoutConstraint.activate([ - emptyStateView.topAnchor.constraint(equalTo: view.topAnchor), - emptyStateView.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor), - emptyStateView.trailingAnchor.constraint(equalTo: view.readableContentGuide.trailingAnchor), - nextStepButton.topAnchor.constraint(equalTo: emptyStateView.bottomAnchor, constant: 21), - ]) // fix AutoLayout warning when observe before view appear viewModel.viewWillAppear @@ -125,6 +116,16 @@ extension MastodonPickServerViewController { nextStepButton.topAnchor.constraint(equalTo: tableView.bottomAnchor, constant: 7), ]) + emptyStateView.translatesAutoresizingMaskIntoConstraints = false + view.addSubview(emptyStateView) + NSLayoutConstraint.activate([ + emptyStateView.topAnchor.constraint(equalTo: view.topAnchor), + emptyStateView.leadingAnchor.constraint(equalTo: tableView.readableContentGuide.leadingAnchor), + emptyStateView.trailingAnchor.constraint(equalTo: tableView.readableContentGuide.trailingAnchor), + nextStepButton.topAnchor.constraint(equalTo: emptyStateView.bottomAnchor, constant: 21), + ]) + view.sendSubviewToBack(emptyStateView) + switch viewModel.mode { case .signIn: nextStepButton.setTitle(L10n.Common.Controls.Actions.signIn, for: .normal)