roberthein / TinyConstraints

Nothing but sugar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIEdgeInsets sugar suggestion

karlpuusepp opened this issue · comments

Hi, I really like the look of this framework. I've been using PureLayout for a while, but it doesn't handle arbitrary layout guides and isn't very Swifty.

Anyway, I've found myself often having to write shorthand static initializers to replace the wordyUIEdgeInsets.init. Would you be open to a PR introducing something like this as part of the framework? This would enable beautifully concise expressions like:

view.edges(to: superview, insets: .uniform(15))

view.edges(to: superview, insets: .top(10) + .bottom(15) + .horizontal(15))