Hacker News new | ask | show | jobs
by jchb 2351 days ago
> Does anyone honestly think this: [ 'H:|[view1(==view2)]-10-[view2]|' 'V:|[view1,view2]|' ] is readable?

This is not Auto layout, it is just an alternative string-based API to express constraints in Auto layout. In practice no-one (that I know) uses Visual Format Language, as it is called, but instead sets up constraints in code or in Xcode Interface builder. In Swift code it would look something like this: view1.leadingAnchor.constraint(equalTo: view2.leadingAnchor, constant: 10) view2.topAnchor.constraint(equalTo: view1.bottomAnchor) ...