-
Notifications
You must be signed in to change notification settings - Fork 49
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
heightForHeaderInSection call #71
Comments
Hi! This was actually intentional, but now as I'm thinking about it, I almost want to reconsider this decision. Some context: Generally all delegate methods are not called by UITableView on DTTableViewManager, because the idea is to only call those methods, if user specified an action to go along with them. However, in case of
If I made this method not callable from UITableView unless user specifies closure will make all this logic to go away. It's not a bad thing, maybe, because all of those can be achieved in different ways, like using self-sizing on tableView headers e.t.c. But this would be a breaking change, which I'm not looking to make at this particular moment. As an option, I'm also considering putting this behind configuration flag, so that user of the framework can decide if he wants this behavior or not. Lets keep this issue open for now and think about it more. Please let me know what you think. |
In the first approximation, making a configuration flag is a good idea. I know that UITableView is black box with bugs running on differents iOS. Can you explain why method call (I reproduce it in simple project by setting sectionHeaderHeight value), and how to fix it? |
Can you describe what behavior specifically are you trying to fix? |
I'll try to fix heightForHeaderInSection |
You need to provide a data model for header by using one of those methods (for MemoryStorage): |
Also you can check if you have any items in current section. If the section is empty, headers are not displayed by default, which is controlled via configuration flag |
Hi! I've decided to move forward with configuration flags for those methods, and planning to ship them in the next major release of DTTableViewManager(release later this fall, after iOS 14 / Xcode 12 GM). Please take a look at current implementation. If there's anything you would want me to change there, please let me know. I'm closing this issue for now, thanks for bringing this up! |
Hi!
Is it a bug that
open func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
called?in simple implementation of UITableView with dataSource/delegate this method not call
The text was updated successfully, but these errors were encountered: