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
Add support for registering decoration view classes rather than nibs #1
Add support for registering decoration view classes rather than nibs #1
Conversation
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.
Hi thank you for the contribution.
I would suggest to make the code more compact. At first it would be useful the avoid the repetition in the if
and else if
branches. Additionally, I would suggest to only have one parameter for each corner, maybe as superclass?
Furthermore, I would appreciate if you would adapt the same code style I used. In particular putting else
blocks on a new line.
Thank you!
Edit: Edit 2: |
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.
Hey,
thank you again for the contribution. The code looks much better now. However, I would suggest to only pass one parameter per DecorationView "corner" as type Any
, then to check wether if its of type AnyClass
or UINib
and finally call the respective registration method. What do you think?
My concerns with that approach are:
If you're ok with both of these, I'll make the change. |
To your concerns:
It would be great if you could update the README and the demo application as well. |
@swoolcock this is addressed in update 1.2.0: |
UICollectionViewLayout
usually supports registering decoration views as both nibs and classes.This change is to allow the
SpreadsheetLayout
subclass to also provide that functionality.