YOLayout/YOLayout — pull request #1 by johnboiles (2014-12-12 17:29:30+00:00)
Title: Draft of block-based layouts

Taking a stab at block-based layouts for YOLayout. Instead of implementing layout:size:, views instead specify a layout block that does the same thing. The advantages are

* You don't need to maintain references to your subviews just for layouts
* You can potentially build a view hierarchy without subclassing views.

One design decision that I'm still on the fence about was adding a convenience method `setLayoutBlock` to YOView. Not sure if this adds much. With the convenience method, you define a layout block like this:

[self setLayoutBlock:^(id layout, CGSize size) {

Without it you'd do this:

self.layout = [YOLayout layoutForView:self layoutBlock:^(id layout, CGSize size) {

Because autocomplete is so good in XCode not sure if much is gained from the first part. Looks simpler, but maybe makes the layout system a little more opaque in how it works.