Comments (7)
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!
from dttableviewmanager.
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. tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath)
is a glaring example of that, because as a framework owner I want to give access to modifying size of the cell via closure, but it should not be called for users that don't specify it, cause it might have huge performance implications.
However, in case of heightForHeaderInSection section
and heightForFooterInSection section
I made an exception from that rule. Currently those methods have a lot of logic in them. It includes:
- Ability to not show header view/title on a section, whose header model is nil
- Calling user defined closure for
heightForHeaderInSection
- Calling
UITableViewDelegate
method if it was defined byDTTableViewManageable
instance - Logic to hide header view for grouped/plain table view style (
minimalHeaderHeightForTableView
property) - Returning
UITableView.automaticDimension
for default string table view header titles - Returning
tableView.sectionHeaderHeight
where header model is not nil.
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.
from dttableviewmanager.
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?
from dttableviewmanager.
Can you describe what behavior specifically are you trying to fix?
from dttableviewmanager.
I'll try to fix heightForHeaderInSection
In simple implantation of view controller with tableview first section of table view has default size ~35.0 and heightForHeaderInSection not call
But when I use DTTableViewManager heightForHeaderInSection call and returns .zero
from dttableviewmanager.
You need to provide a data model for header by using one of those methods (for MemoryStorage): memoryStorage.setSectionHeaderModels
or memoryStorage.headerModelProvider
property to make sure that it's visible.
You can also call manager.heightForHeader(withItem:_:)
method to set height explicitly for each data model.
from dttableviewmanager.
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 manager.configuration.displayHeaderOnEmptySection
.
from dttableviewmanager.
Related Issues (20)
- How update cell, without hidden keyboard? HOT 1
- any advice on putting UICollectionViews into UITableViewCells? HOT 1
- CollapsibleTable
- Cocoapods error HOT 2
- Version 6.1.0-beta.1 is not compiled from original source files HOT 1
- Wrong tableView section header width. HOT 2
- TableView doesn't update without animation after reloadData() HOT 1
- I'm a dummy, but how to set section header? HOT 5
- crash when replacing items using `RealmStorage.setSection`, if amt items in new list don't match... HOT 4
- How to make a cell reuse only for specific indexpath HOT 1
- seeing recursion with DTCollectionViewDelegate canFocus HOT 5
- Add items without animation HOT 2
- Mapping view model for sections with NSFetchedResultsController HOT 1
- Side effect with using coreDataUpdater() HOT 1
- TableViewUpdater for local search HOT 1
- Issue with programmatically added tableView HOT 2
- Setting/Updating section header for specific section HOT 1
- Update Model in UITableViewCell class HOT 7
- Cannot build for simulator on M1 Mac HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dttableviewmanager.