Skip to content

Instantly share code, notes, and snippets.

@ManWithBear
Created November 21, 2016 10:30
Show Gist options
  • Save ManWithBear/8bc4bf59bd543367edb83b669c255049 to your computer and use it in GitHub Desktop.
Save ManWithBear/8bc4bf59bd543367edb83b669c255049 to your computer and use it in GitHub Desktop.
Fix problem with wrong tableHeaderView height
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
// Give system time to properly recalculate tableHeaderView height and update it
// Otherwise wrong height appear on iOS 10
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.tableView.tableHeaderView = self.tableView.tableHeaderView;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment