robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.34k stars 525 forks source link

Allow unlimited amount of views to be used in the constrain function #196

Closed samuelbeek closed 8 years ago

samuelbeek commented 8 years ago

By using the ...-postfix we can have an unlimited amount of views inside the constrain() function. So we can do this:

 constrain(UView(), UIView(), UIView(), UIView(), UIView(), UIView(), UIView(), UIView(), UIView()) { 
view1, view2, view3, view4, view5, view6, view7, view8, view9 in 

}

I found out about this behavior in the through the print function.

samuelbeek commented 8 years ago

Oh, didn't test it well enough.