Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Auto layout is not user-friendly enough to make sense on the web. 99% of the time the format is not readable at all. Does anyone honestly think this: [ 'H:|[view1(==view2)]-10-[view2]|' 'V:|[view1,view2]|' ] is readable?

Especially since Apple admitted their mistake and is moving towards SwiftUI.



> 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) ...


I mean, it doesn't look any less readable than CSS.

Maybe CSS is syntactically easier, but the relationships between elements are much more hidden (width: 100%; of what?) so I'd call it a wash.


You don't think CSS grid[0] is more usable than that? Templates are basically a ASCII-visible representation of the layout.

[0] https://css-tricks.com/snippets/css/complete-guide-grid/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: