IBDecodable / IBLinter

A linter tool for Interface Builder
MIT License
948 stars 42 forks source link

Reasoning behind relative_to_margin rule #49

Closed ManWithBear closed 6 years ago

ManWithBear commented 6 years ago

Can you please describe why you created such rule and what's wrong with that? relative_to_margin

kateinoigakukun commented 6 years ago

I created relative_to_margin rule to force not to use Relative to margin in interface builder. Relative to margin option is only used in IB and this occurs discrepancies between the specified number and displayed margin.

2018-05-25 19 40 54
ManWithBear commented 6 years ago

Actually it's bad practise, since by using layoutMargins and relative to margins you have better flexibility and control over margins in app.

kateinoigakukun commented 6 years ago

I understand what you mean, but in my dev team case we take it seriously to avoid discrepancies between the specified number and displayed margin. I made this as non-default rule because I know it's not common. I'm planning to implement plugin function and move relative_to_margin to external plugin.