chore(onboarding): Decrease spacing between title and top of WelcomeViewController

This commit is contained in:
Marcus Kida 2022-12-28 15:28:09 +01:00 committed by Nathan Mattes
parent 9e1dbe1dff
commit a935cd83bb
2 changed files with 311 additions and 303 deletions

View File

@ -13,6 +13,10 @@ import MastodonLocalization
final class WelcomeViewController: UIViewController, NeedsDependency {
private enum Constants {
static let topAnchorInset: CGFloat = 20
}
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
weak var coordinator: SceneCoordinator! { willSet { precondition(!isViewLoaded) } }
@ -131,7 +135,7 @@ extension WelcomeViewController {
}
NSLayoutConstraint.activate([
pageViewController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
pageViewController.view.topAnchor.constraint(equalTo: view.topAnchor, constant: computedTopAnchorInset),
pageViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
view.trailingAnchor.constraint(equalTo: pageViewController.view.trailingAnchor),
buttonContainer.topAnchor.constraint(equalTo: pageViewController.view.bottomAnchor, constant: 16),
@ -170,6 +174,10 @@ extension WelcomeViewController {
setupIllustrationLayout()
setupButtonShadowView()
}
private var computedTopAnchorInset: CGFloat {
(navigationController?.navigationBar.bounds.height ?? UINavigationBar().bounds.height) + Constants.topAnchorInset
}
}
extension WelcomeViewController {