Thursday, August 3, 2017

CwlLayout: a Swift Wrapper Around Auto Layout

Matt Gallagher:

Much of the debate I see around Auto Layout focusses on how it’s cumbersome to implement in code – as opposed to Interface Builder – but all of the 9 constraints would still need to be applied in Interface Builder to achieve this same layout and you’d still need to understand why each of these constraints is necessary.


The problem is that no matter how you apply them, constraints are not layouts; constraints are building blocks from which we can make layouts but an actual layout requires starting a different way.


A far better solution for programming a declarative system is to use an API that itself is declarative and builds the whole system as a single composeable expression and rather than constructing individual constraints separately, understands the whole system and can automatically include constraints needed for consistency.

Comments RSS · Twitter

Leave a Comment