Skip to content

appcoda/SnapKitDemo

Repository files navigation

A Quick demo for SnapKit

We all create constraints one way or another. Constraints can be made in Interface Builder, or programmatically with pure code. Not all developers have the same preferences; part of developers like using Interface Builder, part of developers like coding the constraints. There are also people who are doing both. The discussion in this post has to do with making constraints in code, but even if you’re an Interface Builder enthusiast, please keep reading. You might find the following content interesting. Also, and for your reference, here’s an older post about making constraints in code.

So, talking about creating constraints programmatically, it’s not that difficult to specify them as far as you know the kind of constraints you need and how they should be combined. But this is often proved to be a cumbersome work because a lot of stuff is needed to be written in order to set all constraints up properly. At the end, it’s easy to end up with big fragments of code that configure constraints which describe the relationship between views, offsets, constants, and so on, but it’s hard to read and modify them. And here’s where SnapKit gets into play.

To continue reading, please refer to the following link:

https://www.appcoda.com/snapkit