-
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
fixes footer and header heights on ios 11 to be automatic dimension if the view returns as 0 #109
Conversation
…f the view returns as 0
Static/DataSource.swift
Outdated
headerHeight = UITableViewAutomaticDimension | ||
} | ||
} | ||
return headerHeight |
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.
Okay I think this makes sense. Can we simplify a bit using a guard?
guard let headerView = section(at: sectionIndex)?.header, let height = headerView.height, height > 0 else {
return UITableViewAutomaticDimension
}
return height
I'm good with this. Please squash down to one commit before merging. 🎱 |
guard let headerView = section(at: sectionIndex)?.header else { return 0 } | ||
|
||
var headerHeight = headerView.viewHeight | ||
if headerHeight == 0 { |
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.
After reading through the documentation, I'm not so sure we should be setting this to automatic given value of zero. Why are we setting to auto here?
open var sectionFooterHeight: CGFloat // default is UITableViewAutomaticDimension
I really don't think this changes are good. This 2.0.2 version changed all my layouts that were fine in iOS 11.. I think you app code its wrong, not this lib |
@txaiwieser for context, how are you setting you footers? Sizing them between iOS10/11? |
I have a lot of tableViews with custom headers and footers and they were working fine in iOS 10 and 11. They have the correct sizing, but now with this new changes on the lib they are wrong even on iOS 10 (Building with Xcode 9) |
@txaiwieser Are you manually laying out their sizes in layoutSubviews or something similar? Or leveraging auto layout for their sizing? |
Have you tried this using .groupped tableViews? all the sectionHeaders and sectionsFooters are now 0 height :/ Am I missing something? |
@txaiwieser I'm experiencing the same thing with grouped table views. Which no longer offers default section header/footer height. I had begun an alternative approach here, which reverts to previous implementation with an addition of potential for auto layout support: But ran into issues in which iOS11 was friendly to autosized sectionFooters, but iOS10 ended up clipping views, not respecting their auto layout provided intrinsic heights. If you're on any public slack chats, would love to follow up with you there to see if we are experiencing the same thing. Otherwise, I can invite you to chat in the slack channel: iosdevelopers.slack.com |
@dmiluski Yes, I'm only on ios-developers.slack.com, but if you can sent me an invitation "[email protected]" |
* Revert "fixes footer and header heights on ios 11 to be automatic dimension if the view returns as 0 (#109)" This reverts commit 319a8b8. * Revert "Merge pull request #108 from nealyoung/extremity-height-fix" This reverts commit 2071110, reversing changes made to e002d86. * Bugfix: SectionFooterView AutoDimension Support Problem: 1. I noticed our app was manually laying out subviews in our sectionFooters when I didn't see the need to. 2. After recent changes, Group tableView's which had nil section extremity defaulted to zero, which drops the standard spacing between sections. Note in attatchment. Notable info: Statics currently has deploy target of iOS8, which did not yet support automatic sectionFooterView dimensioning. Solution: - Offer autosizing option which uses UITableViewAutomaticDimension rather than view's original bounds height. Retain original .view(_) case in the event some clients were already sizing beforehand limiting integration breaks. This also offers automatic margin adherence. - Bump deploy target to iOS9 for clean integration. - Revert 2 previous PRs - Default height for plain/grouped styles to play friendly with tableView's defaults. * Example: AutoSized Extremity
No description provided.