I'm trying to resize my iOS app for any screen dimension with auto layout constraints programmatically, but I don't understand why this specific constraint doesn't work as I expected it to.
I think that the bottom of view1 doesn't fit as it should with top of view2 in this constraint, but I don't understand why ,because if I try this on a new project it works perfectly:
let verticalSpacing2 = NSLayoutConstraint(item: view2, attribute: NSLayoutAttribute.Top,
relatedBy: NSLayoutRelation.Equal, toItem: view1, attribute: NSLayoutAttribute.Bottom,
multiplier: 1, constant: 10)
self.addConstraint(verticalSpacing2)