-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto layout DSL #210
Auto layout DSL #210
Conversation
ReusableView unit tests are breaking but #208 is already open to fix them 👼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished CR, everything looks ace! 🚀
Will wait for the build to pass to check the coverage though 😜
414b776
to
a737f15
Compare
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
==========================================
+ Coverage 94.95% 95.36% +0.41%
==========================================
Files 94 101 +7
Lines 3408 4034 +626
==========================================
+ Hits 3236 3847 +611
- Misses 172 187 +15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of 💅 comments now that we can take advantage of Swift 5.1's implicit return
's, which will make the code look tidier and more compact 😌
The test coverage is a bit lacking though, and if we merge this as is we will drop the project's overall coverage by 10.83% 😢, so I think we should add some more tests to address this. I'll gladly help if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good. Most of the comments are minor improvements, but there are two important issues:
- Unnecessary (duplicated) calls of
prepare
. - Two helper functions on array that can crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done 👏
just 💅 and 💄
- Internally using `NSLayoutConstraints` - Constrainable proxies created for a more "suggary" and readable syntax - Added Array extensions to handle bulk constraint application - Added unit tests
a737f15
to
a9ad12a
Compare
Applied code review suggestions and rebased branch. Currently improving test coverage 📈 |
Code coverage replenished 😌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🎉
Small comment regarding API naming 🚓
Checklist
master
Motivation and Context
The
NSLayoutAnchor
API is very verbose and resulted on big blocks of Auto Layout code that increased the size of the view files and was not very easy to read.As an alternative, Cartography provides a simple and readable DSL to handle Auto Layout code but we've found that the operator overload used on that library was causing our compile times to increase.
Description
All credit goes to @renatorodrigues for the implementation 🙏
The implementation is heavily inspired on Cartography and TinyConstraints.
Without using custom operators, we can still have a more accessible API for our Auto Layout code and avoid the increased build times caused by operator overloads.