Skip to content

Commit 07353dd

Browse files
authored
Maintain the same YLTableView behavior on iOS11 (#30)
1 parent c22bd95 commit 07353dd

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Classes/YLTableView.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
3737

3838
_headerFooterViewClassForReuseIdentifier = [NSMutableDictionary dictionary];
3939
_sizingHeaderFooterViewsForReuseIdentifier = [NSMutableDictionary dictionary];
40+
41+
self.estimatedSectionHeaderHeight = 0;
42+
self.estimatedSectionFooterHeight = 0;
4043
}
4144
return self;
4245
}

Classes/YLTableViewDataSource.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
150150
[self tableView:tableView configureHeader:headerView forSection:section];
151151
return [headerView heightForWidth:CGRectGetWidth(tableView.bounds)];
152152
} else {
153-
return UITableViewAutomaticDimension;
153+
return 0;
154154
}
155155
}
156156

@@ -164,7 +164,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
164164
[self tableView:tableView configureFooter:footerView forSection:section];
165165
return [footerView heightForWidth:CGRectGetWidth(tableView.bounds)];
166166
} else {
167-
return UITableViewAutomaticDimension;
167+
return 0;
168168
}
169169
}
170170

YLTableView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'YLTableView'
3-
s.version = '2.1.0'
3+
s.version = '2.1.1'
44
s.license = {:type => 'Apache 2', :file => 'LICENSE.txt'}
55
s.summary = 'Yelp iOS table view framework'
66
s.homepage = 'https://github.com/Yelp/YLTableView'

0 commit comments

Comments
 (0)