“Width equals height” constraint using visual format language
问题 In order to add width equals to its superview height we can do following NSLayoutConstraint(item: view, attribute: .width, relatedBy: .equal, toItem: view.superview, attribute: .height, multiplier: 1, constant: 0) or we can do it from interface builder But how can I do the same using VFL? 回答1: From the documentation of Auto Layout Guide: Visual Format Language The notation prefers good visualization over completeness of expressibility. Most of the constraints that are useful in real user