PinLayout
PinLayout copied to clipboard
Relative argument naming
Let me start by saying that PinLayout is a fantastic framework, thanks for working so hard on it!
Would it be possible to remove the argument names from the relative edge layout functions? Currently the English for most of them is incorrect. For example, left(of: )
and right(of: )
are perfect but the use of "of" in each function call in the first usage example,
view.pin.after(of: view4).before(of: view1).below(of: view3)
is grammatically incorrect.
Just a thought for readability. Thanks again for the existing work on this library!
Hi @mylesbarros, your remark makes a lot of sense. I'm not a fan of unnecessary breaking change that would force all existing source code to be updated. Another option would be to duplicate these methods, but this, I think would create confusions. 🤔 🤔 🤔
The reason why the API always specify of
is for consistency, so that all methods that reference another view use the of
word. But this was maybe not a good idea.
I have to think about it. It would be nice to have access to a migration tool like Xcode has for Swift.
Anyone else has a remark about this?
Thanks for the explanation, it does make sense in terms of having a consistent API so possibly that's useful for new developers even if it's distracting for others. 🙂
Overall though I would agree that it's probably not worth breaking the API for it unless you bundle it into a larger release.
I noticed that, too, as the grammar used is very weird. @lucdion Perhaps duplicating the methods with deprecation warnings for the old ones?
Very old topic. Closing it, sorry