File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ - (NSInteger)sectionForHeaderView:(UITableViewHeaderFooterView *)headerView {
206206
207207 NSInteger section = NSNotFound ;
208208 NSInteger minSection = 0 ;
209- NSInteger maxSection = self.numberOfSections ;
209+ NSInteger maxSection = self.numberOfSections - 1 ;
210210
211211 CGRect headerViewFrame = headerView.frame ;
212212 CGRect compareHeaderViewFrame;
@@ -220,10 +220,10 @@ - (NSInteger)sectionForHeaderView:(UITableViewHeaderFooterView *)headerView {
220220 }
221221 else if (headerViewFrame.origin .y > compareHeaderViewFrame.origin .y ) {
222222 minSection = middleSection+1 ;
223+ section = middleSection; // Occurs when headerView sticks to the top
223224 }
224225 else {
225226 maxSection = middleSection-1 ;
226- section = maxSection; // Occurs when headerView sticks to the top
227227 }
228228 }
229229
You can’t perform that action at this time.
0 commit comments