I am using NSLayoutAnchor
's constraintEqualToSystemSpacingAfter
for building my layout.
NSLayoutConstraint.activate([
customView.leadingAnchor.constraintEqualToSystemSpacingAfter(safeAreaLayoutGuide.leadingAnchor, multiplier: 1)
])
It actually works, but it throws a warning in the console after I activate the constraints:
Aligning the right edge of a [custom view] with the right edge of a [second custom view] is not recommended. Use an explicit constant for your constraint to override this.
How can I make this warning disappear?
Use NSLayoutAnchor.constraint(equalTo:constant:)
instead of that method.
NSLayoutConstraint.activate([
customView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 0)
])