diff --git a/Sources/Layout/Layout.swift b/Sources/Layout/Layout.swift index c0f75775..bce7964c 100644 --- a/Sources/Layout/Layout.swift +++ b/Sources/Layout/Layout.swift @@ -497,9 +497,9 @@ public final class Layout { // swiftlint:disable:this type_body_length let guide: UILayoutGuide = .init() layoutView.addLayoutGuide(guide) return adding([ - guide.leading.constraint(equalTo: leading), - guide.trailing.constraint(equalTo: trailing), - view.centerX.constraint(equalTo: guide.centerX).withPriority(priority) + guide.leading.constraint(to: leading), + guide.trailing.constraint(to: trailing), + view.centerX.constraint(to: guide.centerX).withPriority(priority) ]) } @@ -555,9 +555,9 @@ public final class Layout { // swiftlint:disable:this type_body_length let guide: UILayoutGuide = .init() layoutView.addLayoutGuide(guide) return adding([ - guide.top.constraint(equalTo: top), - guide.bottom.constraint(equalTo: bottom), - view.centerY.constraint(equalTo: guide.centerY).withPriority(priority) + guide.top.constraint(to: top), + guide.bottom.constraint(to: bottom), + view.centerY.constraint(to: guide.centerY).withPriority(priority) ]) } @@ -593,13 +593,13 @@ public final class Layout { // swiftlint:disable:this type_body_length case .leadingToTrailing: var anchor: NSLayoutXAxisAnchor = first.trailing for view in views.dropFirst() { - adding(view.leading.constraint(equalTo: anchor, constant: spacing).withPriority(priority)) + adding(view.leading.constraint(to: anchor, constant: spacing).withPriority(priority)) anchor = view.trailing } case .leftToRight: var anchor: NSLayoutXAxisAnchor = first.right for view in views.dropFirst() { - adding(view.left.constraint(equalTo: anchor, constant: spacing).withPriority(priority)) + adding(view.left.constraint(to: anchor, constant: spacing).withPriority(priority)) anchor = view.right } } @@ -607,7 +607,7 @@ public final class Layout { // swiftlint:disable:this type_body_length let firstAnchor: NSLayoutYAxisAnchor = first.anchor(for: attribute) let constraints: [NSLayoutConstraint] = views .dropFirst() - .map { $0.anchor(for: attribute).constraint(equalTo: firstAnchor) } + .map { $0.anchor(for: attribute).constraint(to: firstAnchor) } adding(constraints.withPriority(priority)) } return self @@ -637,14 +637,14 @@ public final class Layout { // swiftlint:disable:this type_body_length else { return self } var anchor: NSLayoutYAxisAnchor = first.bottom for view in views.dropFirst() { - adding(view.top.constraint(equalTo: anchor, constant: spacing).withPriority(priority)) + adding(view.top.constraint(to: anchor, constant: spacing).withPriority(priority)) anchor = view.bottom } for attribute: XAxisAttribute in alignment { let firstAnchor: NSLayoutXAxisAnchor = first.anchor(for: attribute) let constraints: [NSLayoutConstraint] = views .dropFirst() - .map { $0.anchor(for: attribute).constraint(equalTo: firstAnchor) } + .map { $0.anchor(for: attribute).constraint(to: firstAnchor) } adding(constraints.withPriority(priority)) } return self diff --git a/Sources/Layout/LayoutItem.swift b/Sources/Layout/LayoutItem.swift index 6142ba51..40620ed5 100644 --- a/Sources/Layout/LayoutItem.swift +++ b/Sources/Layout/LayoutItem.swift @@ -804,22 +804,22 @@ extension LayoutItem { case .top: return layoutItemView .top - .constraint(equalTo: boundary.top, constant: insets.constant(for: .top)) + .constraint(to: boundary.top, constant: insets.constant(for: .top)) .withPriority(priority) case .leading: return layoutItemView .leading - .constraint(equalTo: boundary.leading, constant: insets.constant(for: .leading)) + .constraint(to: boundary.leading, constant: insets.constant(for: .leading)) .withPriority(priority) case .bottom: return layoutItemView .bottom - .constraint(equalTo: boundary.bottom, constant: insets.constant(for: .bottom)) + .constraint(to: boundary.bottom, constant: insets.constant(for: .bottom)) .withPriority(priority) case .trailing: return layoutItemView .trailing - .constraint(equalTo: boundary.trailing, constant: insets.constant(for: .trailing)) + .constraint(to: boundary.trailing, constant: insets.constant(for: .trailing)) .withPriority(priority) } } @@ -834,22 +834,22 @@ extension LayoutItem { case .top: return layoutItemView .top - .constraint(equalTo: boundary.top, constant: insets.constant(for: .top)) + .constraint(to: boundary.top, constant: insets.constant(for: .top)) .withPriority(priority) case .left: return layoutItemView .left - .constraint(equalTo: boundary.left, constant: insets.constant(for: .left)) + .constraint(to: boundary.left, constant: insets.constant(for: .left)) .withPriority(priority) case .bottom: return layoutItemView .bottom - .constraint(equalTo: boundary.bottom, constant: insets.constant(for: .bottom)) + .constraint(to: boundary.bottom, constant: insets.constant(for: .bottom)) .withPriority(priority) case .right: return layoutItemView .right - .constraint(equalTo: boundary.right, constant: insets.constant(for: .right)) + .constraint(to: boundary.right, constant: insets.constant(for: .right)) .withPriority(priority) } }