Storyboards vs. .xibs vs SnapKit

Storyboards

It allows UI creation to be more visual and easier to use.

There are situations in which storyboards should be used:

  1. Beginner Developer
  2. Implementing the Static part of your application
    “What you see is what you get”

Screen Shot 2018-09-12 at 9.21.51 AM

Downsides to storyboards are:

  1. Merge conflicts
  2. Working with Segues
  3. Overall kinda “messy” (from personal experience)

XIBs

A single XIB represents only one visual element. Perfect for when the same element is repeated across an application.

Screen Shot 2018-09-12 at 9.22.55 AM

Screen Shot 2018-09-12 at 9.25.48 AM.png

A good advantage of XIBs is reusability. As seen above, for collection views, I used XIBs file to repeat the same UI.

The downside is conflicts caused.

SnapKit

SnapKit is used to make AutoLayout easier to use.

Create a Podfile and add the following lines from the tutorial of SnapKit. Then update Podfile.

Screen Shot 2018-09-13 at 1.13.39 PM

Screen Shot 2018-09-13 at 2.45.30 PM

Makes constraint writing easier, since AutoLayout can somewhat be tedious at times.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s