Rightpoint / Anchorage

A collection of operators and utilities that simplify iOS layout code.
MIT License
632 stars 46 forks source link

Prevent self-constraint #31

Closed ZevEisenberg closed 7 years ago

ZevEisenberg commented 7 years ago

I just wrote this by mistake:

someView.verticalAnchors == someView.verticalAnchors

I meant to write the similar but distinct:

someView.verticalAnchors == someViewContainer.verticalAnchors

This could be caught at run-time by asserting that the sides of == are not ===.

jvisenti commented 7 years ago

Thanks for the input, but I'm going to leave this out for now. Extra logic required with every constraint created, to check if the LHS and RHS are "equal", and that doesn't seem like a good tradeoff for most cases.