A friendly introduction to SnapKit and it’s benefits over adding standard programmatic constraints.

Written while using XCode 12.4 / SnapKit: 5.0.1

Filmstack Project created with SnapKit.

Full project can be found on my Github

I. Overview

Snapkit is, “… a DSL to make Auto Layout easy on both iOS and OS X.”
In other words, it’s a library to abstract auto layout and simplify the workflow for programmatic constraints.

II. Benefits

So why use SnapKit? Well, some of the benefits include:

Less Code

Constraining a TableView with standard AutoLayout Constraints
Constraining a TableView with SnapKit

Easier

SnapKit is arguably easier to use than…


Xcode version 12.01

Programmatic constraints is a way of laying out and constraining views as opposed to using Storyboards. While more intimidating at first, programmatic constraints can be a faster way to create user interfaces. It just takes some practice.

When creating a new Xcode project, there isn’t a nice preset dropdown option that will configure a boiler plate programmatic project for us.

(You could make your own! Check out: BrianVoong // verebes1)

Here are 5 steps to get your programmatic project set up and leave storyboards behind like a bad ex.

1. TRASH THE MAIN.STORYBOARD

Delete and forget it. You deserve better and want some consistent…


I have been practicing programmatic UI constraints and decided to test my current abilities by building something familiar from scratch.
Two coffees later, I landed on the iOS Discord app.

Full project source code can be found on my github

Breakdown

The messaging screen of Discord can be broken down into three sections.

Leonardo Diaz

mobile software engineer \\\ ☕️💻 📷 https://github.com/leoidiaz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store