-
Notifications
You must be signed in to change notification settings - Fork 87
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
Make Row be agnostic of its presentation #60
Conversation
If you want a custom height for a cell, set tableView.estimatedRowHeight and then add a constraint to cell.contentView to set its height.
If you want to set the color of something, you should use a custom cell.
This reasoning makes sense to me. This would be a breaking API change though, so it might be worth either a) deprecating or b) version bumping 🍏 |
Yeah, I definitely agree with you here. I think one thing this library could benefit from is showing users The Right Way™ to do these kinds of things in the README, so they're less inclined to submit PRs that change the libraries functionality and more inclined to just do it the way the README does. I think I can whip a couple examples up and I'll PR them. |
@dasmer Personally, I'd rather remove them and just bump the major version. |
I’m happy with this revert as long as the tests get updated to reflect the change! |
@ayanonagon done! |
Cool if I click the green button? |
Make Row be agnostic of its presentation
Row shouldn't know anything about how its displayed (with the exception of specifying a class to display it). This was the original design of Static. I'm proposing going back to that mindset with a few small changes.
Remove Height
If you want a custom height for a cell, set
tableView.estimatedRowHeight
and then add a constraint tocell.contentView
to set its height. This is a much more flexible way to go about custom heights if you need varying heights in the same table view.Remove Image Tint Color
From the very beginning, you couldn't set a label's color. This was by design. If you wanted to change the presentation of a label, you had to make a custom cell. I think this same thinking applies to images. If you want to set the color of an image, either do it before it gets to the Row or do it in the cell. Having the Row tell the cell what color it is violates its lack of understanding of presentation.
I tried to explain my reasoning. Hopefully this doesn't seem silly. It's awesome to see people contributing to Static, but I think these two additions are going the wrong direction. Thoughts? ❤️