ScottRobbins / DeclarativeLayout

A declarative, expressive and efficient way to lay out your views.
MIT License
5 stars 0 forks source link

Support layout guides #13

Closed ScottRobbins closed 5 years ago

ScottRobbins commented 5 years ago

UILayoutGuides are a really good way to do things like bound subcomponents to that layout guide without making a dummy view.

It should look something like

viewLayout.updateLayoutTo { (component, view) in
    component.addLayoutGuide(layoutGuide) { (component, layoutGuide, superView) in 
        ...
    }
}

This should include updates to the readme for snippets and an example should use it.

ScottRobbins commented 5 years ago

I also don't think that this component it passes into the closure should allow you to add views of any kind. While it may in some cases reflect how we think of layout guides visually, it doesn't reflect how UIKit thinks of layout guides and adding a view to a layout guide isn't a thing.

ScottRobbins commented 5 years ago

Added here