maybe it’s because I’m inexperienced, but why remove storyboards and import another “big” library….
theStoic
1

Hi theStoic, that’s a good question. I’ll split then in two.

Why remove storyboards?

Storyboards help a lot of developers, even me, in small projects or simple ones. But you can say "Well I’m working in a big company with big projects and we use storyboards, are we doing it wrong?" No! you can use storyboards whenever you want. Here are a few common issues that I had that make me change my mind when using storyboard.

  • Merge conflict in a storyboard file. Merge conflicts break all auto-generate code inside storyboards and it’s really annoying to solve it.
  • Reusability of our views.
  • Storyboards files can get really big and sometimes take a time to load.

Why use Cartography (SnapKit or any other)?

If you are working with iOS9+ you can use Apple’s Anchor that works fine, but if not, libraries like Cartography help us to write constraints. It’s easier and human readable than the Visual Format Language

e.g. of Visual Format Language

NSLayoutConstraint.constraintsWithVisualFormat("H|-hp-[iconImageView(iconImageViewWidth)]-[appNameLabel]-[skipButton]-hp-|",options: [.alignAllCenterY], metrics: metrics, views: views)

This example was removed from raywenderlich

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.