8000 Fix display of empty headers on iOS 11 by nealyoung · Pull Request #108 · venmo/Static · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix display of empty headers on iOS 11 #108

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

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Static/DataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ extension DataSource: UITableViewDataSource {
}

public func tableView(_ tableView: UITableView, heightForHeaderInSection sectionIndex: Int) -> CGFloat {
return section(at: sectionIndex)?.header?.viewHeight ?? UITableViewAutomaticDimension
return section(at: sectionIndex)?.header?.viewHeight ?? 0
}

public func tableView(_ tableView: UITableView, titleForFooterInSection sectionIndex: Int) -> String? {
Expand All @@ -216,7 +216,7 @@ extension DataSource: UITableViewDataSource {
}

public func tableView(_ tableView: UITableView, heightForFooterInSection sectionIndex: Int) -> CGFloat {
return section(at: sectionIndex)?.footer?.viewHeight ?? UITableViewAutomaticDimension
return section(at: sectionIndex)?.footer?.viewHeight ?? 0
}

public func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
Expand Down
7 changes: 5 additions & 2 deletions Static/Section.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ public struct Section: Hashable, Equatable {
}
}

var viewHeight: CGFloat? {
return _view?.bounds.height
var viewHeight: CGFloat {
switch self {
case .title: return UITableViewAutomaticDimension
case .view(let extremityView): return extremityView.bounds.height
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now loses auto-sizing for view extremities does it not?

}
}
}

Expand Down
0