Skip to content

Instantly share code, notes, and snippets.

@thornpig
Last active April 5, 2016 00:34
Show Gist options
  • Save thornpig/2b907a053e72f8350338 to your computer and use it in GitHub Desktop.
Save thornpig/2b907a053e72f8350338 to your computer and use it in GitHub Desktop.
Resize tableView footer view
//update footer view's frame
-(void)updateFrame
{
CGSize newSize = [self systemLayoutSizeFittingSize: CGSizeMake(CGRectGetWidth(self.frame), CGFLOAT_MAX)];
CGRect newFrame = self.frame;
newFrame.size = newSize;
self.frame = newFrame;
}
//when updating footer, need to call tableFooterView's setter in tableView to invoke resetting the tableview's contentView bounds
[UIView animateWithDuration: 0.3 animations:^{
[self updateFrame];
self.parentTableView.tableFooterView = self; // has to call tableFooterView setter to update tableview's contentview bounds
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment