WeView 2

An alternative to iOS Auto Layout

Why use WeView 2?

Summary: iOS Auto-Layout is complex and unwieldy and yields ugly code.

Layout Snapshot

Here’s the layout using iOS Auto Layout:

iOS Auto Layout also supports a Visual Format Language. Here’s the same layout using VFL:

Here’s the equivalent logic using a WeView:

iOS Auto Layout has the advantage of being integrated into Interface Builder, and the Inteface Builder support for iOS Auto Layout has dramatically improved in Xcode 5. However, as soon as you outgrow what can done in Interface Builder, you must work programmatically and iOS Auto Layout requires verbose, brittle code.

WeView 2 can only be used programmatically, and is designed to yield concise, expressive and maintainable code. The benefits of the syntax only become more clear as layouts become more complex.

Other Alternatives: