Remove obsolete constraint (IOS-134)

This commit is contained in:
Nathan Mattes 2023-04-06 23:50:12 +02:00
parent 6ba8c7720a
commit 4f870f9bc8
1 changed files with 1 additions and 15 deletions

View File

@ -32,7 +32,6 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
private(set) lazy var viewModel = WelcomeViewModel(context: context) private(set) lazy var viewModel = WelcomeViewModel(context: context)
let welcomeIllustrationView = WelcomeIllustrationView() let welcomeIllustrationView = WelcomeIllustrationView()
var welcomeIllustrationViewBottomAnchorLayoutConstraint: NSLayoutConstraint?
private(set) lazy var mastodonLogo: UIImageView = { private(set) lazy var mastodonLogo: UIImageView = {
let imageView = UIImageView(image: Asset.Scene.Welcome.mastodonLogo.image) let imageView = UIImageView(image: Asset.Scene.Welcome.mastodonLogo.image)
@ -208,18 +207,6 @@ extension WelcomeViewController {
} }
override func viewSafeAreaInsetsDidChange() {
super.viewSafeAreaInsetsDidChange()
var overlap: CGFloat = 5
// shift illustration down for non-notch phone
if view.safeAreaInsets.bottom == 0 {
overlap += 56
}
welcomeIllustrationViewBottomAnchorLayoutConstraint?.constant = overlap
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection) super.traitCollectionDidChange(previousTraitCollection)
@ -272,14 +259,13 @@ extension WelcomeViewController {
welcomeIllustrationView.contentMode = .scaleAspectFit welcomeIllustrationView.contentMode = .scaleAspectFit
welcomeIllustrationView.translatesAutoresizingMaskIntoConstraints = false welcomeIllustrationView.translatesAutoresizingMaskIntoConstraints = false
welcomeIllustrationViewBottomAnchorLayoutConstraint = welcomeIllustrationView.bottomAnchor.constraint(equalTo: separator.centerYAnchor)
view.addSubview(welcomeIllustrationView) view.addSubview(welcomeIllustrationView)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
view.leftAnchor.constraint(equalTo: welcomeIllustrationView.leftAnchor, constant: 15), view.leftAnchor.constraint(equalTo: welcomeIllustrationView.leftAnchor, constant: 15),
welcomeIllustrationView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 15), welcomeIllustrationView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 15),
welcomeIllustrationViewBottomAnchorLayoutConstraint!.priority(.required - 1), welcomeIllustrationView.bottomAnchor.constraint(equalTo: separator.centerYAnchor)
]) ])
welcomeIllustrationView.cloudBaseImageView.addMotionEffect( welcomeIllustrationView.cloudBaseImageView.addMotionEffect(