Skip to content

Commit

Permalink
Merge pull request #118 from iZettle/fix-table-headers-and-footers-iOS10
Browse files Browse the repository at this point in the history
Fix a problem with dynamic sizing headers/footers on iOS 10
  • Loading branch information
nataliq-pp authored Aug 15, 2019
2 parents ac5101b + db32cbd commit b208df2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.10.3
- Bugfix: Fix table section header/footer height calculation on iOS 10

## 1.10.2
- Bugfix: Fix scrollview top pinning on iOS 11 and later where currently if the scrollview is in a navigation controller there is a gap between the scrollview top and the pinned view

Expand Down
2 changes: 1 addition & 1 deletion Form/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.10.2</string>
<string>1.10.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 10 additions & 2 deletions Form/TableKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ public final class TableKit<Section, Row> {

view.sectionHeaderHeight = UITableView.automaticDimension
view.sectionFooterHeight = UITableView.automaticDimension
view.estimatedSectionHeaderHeight = style.fixedHeaderHeight ?? UITableView.automaticDimension
view.estimatedSectionFooterHeight = style.fixedFooterHeight ?? UITableView.automaticDimension

if #available(iOS 11.0, *) {
view.estimatedSectionHeaderHeight = style.fixedHeaderHeight ?? UITableView.automaticDimension
view.estimatedSectionFooterHeight = style.fixedFooterHeight ?? UITableView.automaticDimension
} else {
// on iOS 10 estimated height need to be set to a positive value (the actual one doesn't seem to affect the result but might affect performance) for the size calculation to happen properly
// https://stackoverflow.com/a/50513288
view.estimatedSectionHeaderHeight = style.fixedHeaderHeight ?? 44
view.estimatedSectionFooterHeight = style.fixedFooterHeight ?? 44
}

if view.autoResizingTableHeaderView === tableHeader {
tableHeaderConstraint.constant = style.form.insets.top
Expand Down
2 changes: 1 addition & 1 deletion FormFramework.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "FormFramework"
s.version = "1.10.2"
s.version = "1.10.3"
s.module_name = "Form"
s.summary = "Powerful iOS layout and styling"
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FormTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.10.2</string>
<string>1.10.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit b208df2

Please sign in to comment.