Skip to content
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

Merged
merged 5 commits into from
Aug 28, 2017

Conversation

rhaining
Copy link
Contributor

No description provided.

headerHeight = UITableViewAutomaticDimension
}
}
return headerHeight
Copy link
Contributor

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

@hyperspacemark
Copy link
Contributor

I'm good with this. Please squash down to one commit before merging. 🎱

@rhaining rhaining merged commit 319a8b8 into master Aug 28, 2017
@rhaining rhaining deleted the ios11-height-fixes branch August 28, 2017 19:28
guard let headerView = section(at: sectionIndex)?.header else { return 0 }

var headerHeight = headerView.viewHeight
if headerHeight == 0 {
Copy link
Contributor

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

dmiluski pushed a commit to dmiluski/Static that referenced this pull request Aug 29, 2017
…ension if the view returns as 0 (venmo#109)"

This reverts commit 319a8b8.
@txaiwieser
Copy link
Contributor

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

@dmiluski
Copy link
Contributor

@txaiwieser for context, how are you setting you footers? Sizing them between iOS10/11?

@txaiwieser
Copy link
Contributor

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)

@dmiluski
Copy link
Contributor

@txaiwieser Are you manually laying out their sizes in layoutSubviews or something similar? Or leveraging auto layout for their sizing?

@txaiwieser
Copy link
Contributor

Have you tried this using .groupped tableViews? all the sectionHeaders and sectionsFooters are now 0 height :/

Am I missing something?

@dmiluski
Copy link
Contributor

dmiluski commented Sep 12, 2017

@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:
#110

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

@txaiwieser
Copy link
Contributor

@dmiluski Yes, I'm only on ios-developers.slack.com, but if you can sent me an invitation "[email protected]"

rhaining pushed a commit that referenced this pull request Oct 4, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants