Created
August 26, 2015 09:48
-
-
Save julian-weinert/afe440f1e4f4fd5d5fb6 to your computer and use it in GitHub Desktop.
`-scrollViewDidScroll` not called when `UITableView` removes a section and must scroll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface GISTViewController : UITableViewController | |
@end | |
@implementation GISTViewController | |
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | |
return 3; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
if (section == 0) { | |
return 1; | |
} | |
else if (section == 1) { | |
if ([tableView isEditing]) { | |
return 10; | |
} | |
else { | |
return 0; | |
} | |
} | |
else if (section == 2) { | |
return 2; | |
} | |
return 0; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
return [tableView dequeueReusableCellWithIdentifier:@"identifier" forIndexPath:indexPath]; | |
} | |
- (void)setEditing:(BOOL)editing animated:(BOOL)animated { | |
[super setEditing:editing animated:animated]; | |
[[self tableView] reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationAutomatic]; | |
} | |
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
NSLog(@"hey there, Im scrolling!"); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment