Skip to content

Commit 7fe2233

Browse files
committed
layoutIfNeeded for iOS 9 only
1 parent cb07330 commit 7fe2233

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

TableHeader/TableHeaderObjC/TableHeaderObjC/ListTableViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ - (void)viewDidLayoutSubviews {
9898

9999
// Now that the table view header is sized correctly have
100100
// the table view redo its layout so that the cells are
101-
// correcly positioned under the new header size.
101+
// correcly positioned for the new header size.
102+
103+
// This only seems to be necessary on iOS 9.
102104

103105
[self.tableView layoutIfNeeded];
104106
}

TableHeader/TableHeaderSwift/TableHeader/ListTableViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class ListTableViewController: UITableViewController {
103103
// the table view redo its layout so that the cells are
104104
// correcly positioned for the new header size.
105105

106+
// This only seems to be necessary on iOS 9.
107+
106108
tableView.layoutIfNeeded()
107109
}
108110
}

0 commit comments

Comments
 (0)