Skip to content

Instantly share code, notes, and snippets.

@uberbruns
Last active December 20, 2015 14:29
Show Gist options
  • Save uberbruns/6146542 to your computer and use it in GitHub Desktop.
Save uberbruns/6146542 to your computer and use it in GitHub Desktop.
Makes the first row of an UITableView ignoring the bounce effect, like the gallery for highlights in the AppStore App.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView.contentOffset.y < 0) {
UIView * firstCell = [_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
firstCell.frame = ({
CGRect frame = firstCell.frame;
frame.origin.y = 0;
[_tableView.superview convertRect:frame toView:firstCell.superview];
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment