3 ms·
Cartography: Declarative Auto Layout in Swift
- cageface 11y agoI've been using SnapKit, a similar library, with great success recently: https://github.com/SnapKit/SnapKit https://github.com/SnapKit/SnapKit In fact I've essentially ditched interface builder for my last two projects. I've found this to be an overall boost in productivity and code maintainability, particularly on team projects. I was skeptical of doing layout in code and I'm not sure I'd advocate doing this in ObjC but the expressiveness of Swift makes it possible to build such a nice DSL for layout that I think it's a net win over IB and Storyboards.
- jurip 11y agoWe've been using Masonry (https://github.com/SnapKit/Masonry https://github.com/SnapKit/Masonry), the predecessor to SnapKit, on a pretty large Objective-C project for the last year and a half. We do have some constraints in XIBs but lots in code, too. It's been great and I'd absolutely, without hesitation, recommend it to anyone.
- jurip 11y agoAlso worth checking out is NSLayoutAnchor in iOS 9 and OS X 10.11. It looks like it might lessen the need for libraries like this.
- dep_b 11y agoCartography looks really elegant and that's why I like it. Masonry was too JavaScripty for my taste, all that jQuery like chained pseudo commands. This really looks just like a config instead of code, and it should be.