Masonry-FlattenLayout 0.1.0

Masonry-FlattenLayout 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2016

Maintained by doggy.



More ergonomic thinkable and readable code with the new methods: .gap() .equalTill() .greaterOrEqualTill()

Masonry is good and this extension makes it better!

Previously, an relative layout is a point to point assignment. An example for the view1's mas_make:

  • make.right.equalTo(view2.mas_left).offset(-10) The right layout constraint of view1 are considered with particular edge, not with particular view. The .offset(-10) is similar so we need thinking its value should be whether positive nor negative.

  • equalTill(), provides a view based assignment method in flatten layout make.right.equalTill(view2) is same as make.right.equalTo(view2.mas_left) The magic of this mechanism work is .equalTill() will lookup the firstLayoutAttribute of contraint and deciding which secondLayoutAttribute should be. Also, make.top.equalTill(view2) is same as make.top.equalTo(view2.mas_bottom)

  • gap(), provide a view based offset value make.right.equalTo(view2.mas_left).gap(10) is same as make.right.equalTo(view2.mas_left).offset(-10)

Seen that? View based flatten layout gives you an easier life! You won't confusing which edge is need in relative layout and it autocompleted with equalTill()

One more, make the combination (of course you can): make.right.equalTill(view2).gap(10)

Installation

pod 'Masonry-FlattenLayout'

Authors

doggy

License

MIT